<?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_dangjian.dao.ComPbMemberRoleDAO">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_dangjian.model.dos.ComPbMemberRoleDO">
|
<id column="id" property="id" />
|
<result column="phone" property="phone" />
|
<result column="is_reg" property="isReg" />
|
<result column="name" property="name" />
|
<result column="sex" property="sex" />
|
<result column="birth_time" property="birthTime" />
|
<result column="position" property="position" />
|
<result column="position_two" property="positionTwo" />
|
<result column="job_responsibilities" property="jobResponsibilities" />
|
<result column="photo_path" property="photoPath" />
|
<result column="create_at" property="createAt" />
|
<result column="update_at" property="updateAt" />
|
<result column="community_id" property="communityId" />
|
<result column="org_id" property="orgId" />
|
<result column="check_unit_id" property="checkUnitId" />
|
<result column="id_card" property="idCard" />
|
<result column="type" property="type" />
|
<result column="join_time" property="joinTime" />
|
<result column="employment_time" property="employmentTime" />
|
<result column="function" property="function" />
|
<result column="specialty_category" property="specialtyCategory" />
|
<result column="specialty_name" property="specialtyName" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, phone, is_reg, name, sex, birth_time, position, position_two, job_responsibilities, photo_path, create_at, update_at, community_id, org_id
|
, check_unit_id, id_card, type, join_time, employment_time, function, specialty_category, specialty_name
|
</sql>
|
|
<select id="getSysUserIdByPhone" resultType="long">
|
SELECT user_id FROM sys_user WHERE phone = #{phone} AND app_id = #{appid} AND `type` = 1
|
</select>
|
|
<select id="getSysUserByIdCardCount" resultType="integer">
|
SELECT count(user_id) FROM sys_user WHERE id_card = #{idCard} AND `type` = 1
|
</select>
|
|
<select id="getUserIdByIdCard" resultType="long">
|
select user_id from sys_user WHERE id_card = #{idCard} AND `type` = 1
|
</select>
|
|
<select id="pagePartyOrganization" resultType="com.panzhihua.common.model.vos.partybuilding.west.PartyCommitteeVO">
|
select cpmr.id,cpmr.community_id,cpmr.`name`,cpmr.id_card,cpmr.org_id,cpmr.check_unit_id
|
, cpmr.phone,cpmr.is_reg,cpmr.sex,cpmr.birth_time,cpmr.position,cpmr.position_two
|
, cpmr.job_responsibilities,cpmr.photo_path,cpmr.type,cpmr.join_time,cpmr.employment_time
|
, cpmr.create_at,cpmr.update_at,cpmr.function,cpmr.specialty_category,cpmr.specialty_name
|
,YEAR (now()) - YEAR (substring(cpmr.id_card, 7, 8)) age,cpo.`name` as orgName,cpcu.`name` as checkUnitName
|
from com_pb_member_role as cpmr
|
left join com_pb_org as cpo on cpo.id = cpmr.org_id
|
left join com_pb_check_unit as cpcu on cpcu.id = cpmr.check_unit_id
|
<where>
|
<if test="partyCommitteeVO.communityId != null">
|
and cpmr.community_id = #{partyCommitteeVO.communityId}
|
</if>
|
<if test="partyCommitteeVO.type != null">
|
and cpmr.type = #{partyCommitteeVO.type}
|
</if>
|
<if test="partyCommitteeVO.sex != null">
|
and cpmr.sex = #{partyCommitteeVO.sex}
|
</if>
|
<if test="partyCommitteeVO.keyWord != null and partyCommitteeVO.keyWord != ''">
|
and (cpmr.name like concat (#{partyCommitteeVO.keyWord},'%') or
|
cpmr.phone like concat (#{partyCommitteeVO.keyWord},'%') or
|
cpmr.id_card = #{partyCommitteeVO.keyWord}
|
)
|
</if>
|
</where>
|
order by cpmr.create_at desc
|
</select>
|
|
|
|
<select id="pagePartyOrganizations" resultType="com.panzhihua.common.model.vos.partybuilding.PartyCommitteeVO">
|
select cpmr.id,cpmr.community_id,cpmr.`name`,cpmr.id_card,cpmr.org_id,cpmr.check_unit_id
|
, cpmr.phone,cpmr.is_reg,cpmr.sex,cpmr.birth_time,cpmr.position,cpmr.position_two
|
, cpmr.job_responsibilities,cpmr.photo_path,cpmr.type,cpmr.join_time,cpmr.employment_time
|
, cpmr.create_at,cpmr.update_at,cpmr.function,cpmr.specialty_category,cpmr.specialty_name
|
,YEAR (now()) - YEAR (substring(cpmr.id_card, 7, 8)) age,cpo.`name` as orgName,cpcu.`name` as checkUnitName
|
from com_pb_member_role as cpmr
|
left join com_pb_org as cpo on cpo.id = cpmr.org_id
|
left join com_pb_check_unit as cpcu on cpcu.id = cpmr.check_unit_id
|
<where>
|
<if test="partyCommitteeVO.communityId != null">
|
and cpmr.community_id = #{partyCommitteeVO.communityId}
|
</if>
|
<if test="partyCommitteeVO.type != null">
|
and cpmr.type = #{partyCommitteeVO.type}
|
</if>
|
<if test="partyCommitteeVO.sex != null">
|
and cpmr.sex = #{partyCommitteeVO.sex}
|
</if>
|
<if test="partyCommitteeVO.keyWord != null and partyCommitteeVO.keyWord != ''">
|
and (cpmr.name like concat (#{partyCommitteeVO.keyWord},'%') or
|
cpmr.phone like concat (#{partyCommitteeVO.keyWord},'%') or
|
cpmr.id_card = #{partyCommitteeVO.keyWord}
|
)
|
</if>
|
</where>
|
order by cpmr.create_at desc
|
</select>
|
|
</mapper>
|