deb
This commit is contained in:
parent
9ac8ef0eee
commit
10929596a4
|
|
@ -4,7 +4,8 @@ import lombok.Data;
|
|||
|
||||
@Data
|
||||
public class DockerSearchQuery {
|
||||
private String name;
|
||||
private Integer sectionId;
|
||||
private String keyword;
|
||||
private Integer role;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.syjiaer.clinic.server.mapper.organization;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||
import com.syjiaer.clinic.server.entity.organization.dto.DockerSearchQuery;
|
||||
import com.syjiaer.clinic.server.entity.organization.vo.MemberVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
|
@ -20,6 +21,6 @@ import java.util.List;
|
|||
*/
|
||||
public interface OrganizationMemberMapper extends BaseMapper<OrganizationMember> {
|
||||
|
||||
List<MemberVo> selectDetailByIds(@Param("ids") List<Integer> ids);
|
||||
List<MemberVo> selectDetailByQuery(DockerSearchQuery query);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,21 +153,6 @@ public class OrganizationMemberService extends BaseService {
|
|||
if (dockerSearchQuery == null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.select("id");
|
||||
if (dockerSearchQuery.getName() != null){
|
||||
queryWrapper.like("name", dockerSearchQuery.getName());
|
||||
}
|
||||
if (dockerSearchQuery.getSectionId() != null){
|
||||
queryWrapper.eq("section_id", dockerSearchQuery.getSectionId());
|
||||
}
|
||||
if (dockerSearchQuery.getRole() != null){
|
||||
queryWrapper.eq("role", dockerSearchQuery.getRole());
|
||||
}
|
||||
|
||||
List<Integer> ids = organizationMemberMapper.selectObjs(queryWrapper);
|
||||
|
||||
return organizationMemberMapper.selectDetailByIds(ids);
|
||||
return organizationMemberMapper.selectDetailByQuery(dockerSearchQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,17 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper">
|
||||
|
||||
<select id="selectDetailByIds" resultType="com.syjiaer.clinic.server.entity.organization.vo.MemberVo">
|
||||
<select id="selectDetailByQuery" resultType="com.syjiaer.clinic.server.entity.organization.vo.MemberVo">
|
||||
SELECT om.*,os.name AS section_name
|
||||
FROM organization_member AS om LEFT JOIN organization_section AS os ON om.section_id = os.id
|
||||
WHERE om.id IN
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
om.name LIKE concat('%', #{keyword}, '%')
|
||||
or os.name LIKE concat('%', #{keyword}, '%')
|
||||
</if>
|
||||
<if test="role != null">
|
||||
And om.role = #{role}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue