<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.panzhihua.service_community.dao.ComClusterOrganizationMemberMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComClusterOrganizationMemberDO">
|
<id column="id" property="id" />
|
<result column="cluster_id" property="clusterId" />
|
<result column="name" property="name" />
|
<result column="phone" property="phone" />
|
<result column="address" property="address" />
|
<result column="image_url" property="imageUrl" />
|
<result column="job" property="job" />
|
<result column="id_card" property="idCard" />
|
<result column="nation_code" property="nationCode" />
|
<result column="status" property="status" />
|
<result column="is_del" property="isDel" />
|
<result column="create_at" property="createAt" />
|
<result column="update_at" property="updateAt" />
|
<result column="community_id" property="communityId" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, cluster_id, name, phone, address, image_url, job, id_card, nation_code, status, is_del, create_at, update_at, community_id
|
</sql>
|
|
<select id="pageClusterMemberApplets" resultType="com.panzhihua.common.model.vos.community.cluster.PageClusterMemberVo">
|
SELECT
|
ccom.id,ccom.`name`,ccom.cluster_id,cco.`name` as clusterName,ccom.phone,ccom.address,ccom.image_url,ccom.job,ccom.id_card
|
FROM
|
com_cluster_organization_member AS ccom
|
LEFT JOIN com_cluster_organization AS cco ON cco.id = ccom.cluster_id
|
<where>
|
ccom.status = 1 and ccom.is_del = 2
|
<if test="pageClusterMemberDto.communityId != null">
|
and ccom.community_id = ${pageClusterMemberDto.communityId}
|
</if>
|
<if test="pageClusterMemberDto.clusterId != null">
|
and ccom.cluster_id = #{pageClusterMemberDto.clusterId}
|
</if>
|
<if test="pageClusterMemberDto.keyWord != null and pageClusterMemberDto.keyWord != """>
|
and ccom.`name` like concat(#{pageClusterMemberDto.keyWord}, '%' )
|
</if>
|
</where>
|
order by ccom.create_at desc
|
</select>
|
|
<select id="pageClusterMemberAdmin" resultType="com.panzhihua.common.model.vos.community.cluster.admin.PageClusterMemberAdminVo">
|
SELECT
|
ccom.id,
|
ccom.`name`,
|
ccom.image_url,
|
cco.`name` AS clusterName,
|
ccom.job,
|
ccom.phone,
|
ccom.`status`
|
FROM
|
com_cluster_organization_member AS ccom
|
LEFT JOIN com_cluster_organization AS cco ON cco.id = ccom.cluster_id
|
WHERE
|
ccom.is_del = 2
|
<if test="pageClusterMemberAdminDto.communityId != null">
|
and ccom.community_id = ${pageClusterMemberAdminDto.communityId}
|
</if>
|
<if test="pageClusterMemberAdminDto.status != null">
|
and ccom.`status` = #{pageClusterMemberAdminDto.status}
|
</if>
|
<if test="pageClusterMemberAdminDto.clusterId != null">
|
and ccom.cluster_id = #{pageClusterMemberAdminDto.clusterId}
|
</if>
|
<if test="pageClusterMemberAdminDto.keyWord != null">
|
and (
|
ccom.`name` like concat(#{pageClusterMemberAdminDto.keyWord}, '%' ) or
|
ccom.phone like concat(#{pageClusterMemberAdminDto.keyWord}, '%' )
|
)
|
</if>
|
order by ccom.create_at desc
|
</select>
|
|
<select id="memberNationListAdmin" resultType="com.panzhihua.common.model.vos.community.cluster.admin.ClusterMemberNationVo">
|
SELECT
|
dict_value AS nationCode,
|
dict_item_name AS nationName
|
FROM
|
bc_dictionary_item
|
WHERE
|
dict_id = (
|
SELECT
|
id
|
FROM
|
bc_dictionary
|
WHERE
|
`dict_key` = #{key})
|
</select>
|
|
<select id="getNationCode" resultType="Map">
|
SELECT
|
dict_value
|
FROM
|
bc_dictionary_item
|
WHERE
|
dict_id = ( SELECT id FROM bc_dictionary WHERE dict_key =#{key} )
|
AND dict_item_name = #{nationName}
|
</select>
|
|
<select id="exportClusterMember" resultType="com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelExportAdminVO">
|
SELECT
|
ccom.`name`,
|
cco.`name` AS clusterName,
|
ccom.job,
|
ccom.phone,
|
case ccom.`status`
|
when '1' then '启用'
|
when '2' then '停用'
|
end `status`
|
FROM
|
com_cluster_organization_member AS ccom
|
LEFT JOIN com_cluster_organization AS cco ON cco.id = ccom.cluster_id
|
WHERE
|
ccom.is_del = 2
|
<if test="pageClusterMemberAdminDto.communityId != null">
|
and ccom.community_id = ${pageClusterMemberAdminDto.communityId}
|
</if>
|
<if test="pageClusterMemberAdminDto.status != null">
|
and ccom.`status` = #{pageClusterMemberAdminDto.status}
|
</if>
|
<if test="pageClusterMemberAdminDto.clusterId != null">
|
and ccom.cluster_id = #{pageClusterMemberAdminDto.clusterId}
|
</if>
|
<if test="pageClusterMemberAdminDto.keyWord != null">
|
and (
|
ccom.`name` like concat(#{pageClusterMemberAdminDto.keyWord}, '%' ) or
|
ccom.phone like concat(#{pageClusterMemberAdminDto.keyWord}, '%' )
|
)
|
</if>
|
order by ccom.create_at desc
|
</select>
|
</mapper>
|