|
|
@ -23,4 +23,80 @@ |
|
|
|
AND USER_ID = #{userId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getVoterRegistrationList" resultType="com.elink.esua.epdc.dto.VoterRegistrationDTO"> |
|
|
|
SELECT |
|
|
|
r.ID, |
|
|
|
r.`NAME`, |
|
|
|
r.ID_NUMBER, |
|
|
|
case r.SEX when '0' then '女' when '1' then '男' else '未知' end as sex, |
|
|
|
r.BIRTHDAY, |
|
|
|
r.MOBILE, |
|
|
|
r.NATION_NAME, |
|
|
|
r.DOMICILE, |
|
|
|
r.UPDATED_TIME, |
|
|
|
c1.CONFIG_NAME AS constituencyName, |
|
|
|
c2.CONFIG_NAME AS groupName, |
|
|
|
c3.CONFIG_NAME AS participationPrincipleName, |
|
|
|
r.REMARK |
|
|
|
FROM |
|
|
|
epdc_voter_registration r |
|
|
|
LEFT JOIN epdc_voter_registration_config c1 ON c1.CONFIG_CODE = r.CONSTITUENCY_CODE AND c1.DEL_FLAG = '0' |
|
|
|
LEFT JOIN epdc_voter_registration_config c2 ON c2.CONFIG_CODE = r.GROUP_CODE AND c2.DEL_FLAG = '0' |
|
|
|
LEFT JOIN epdc_voter_registration_config c3 ON c3.CONFIG_CODE = r.PARTICIPATION_PRINCIPLE_CODE AND c3.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
r.DEL_FLAG = '0' |
|
|
|
<if test="constituencyCode != '' and constituencyCode != null"> |
|
|
|
and c1.CONFIG_CODE = #{constituencyCode} |
|
|
|
</if> |
|
|
|
<if test="groupCode != '' and groupCode != null"> |
|
|
|
and c2.CONFIG_CODE = #{groupCode} |
|
|
|
</if> |
|
|
|
<if test="participationPrincipleCode != '' and participationPrincipleCode != null"> |
|
|
|
and c3.CONFIG_CODE = #{participationPrincipleCode} |
|
|
|
</if> |
|
|
|
<if test="domicile != '' and domicile != null"> |
|
|
|
and r.DOMICILE like concat('%', #{domicile}, '%') |
|
|
|
</if> |
|
|
|
<if test="sex != '' and sex != null"> |
|
|
|
and r.SEX = #{sex} |
|
|
|
</if> |
|
|
|
<if test="name != '' and name != null"> |
|
|
|
and r.NAME like concat('%', #{name}, '%') |
|
|
|
</if> |
|
|
|
<if test="mobile != '' and mobile != null"> |
|
|
|
and r.MOBILE like concat('%', #{mobile}, '%') |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != ''"> |
|
|
|
and DATE_FORMAT(r.BIRTHDAY,'%Y-%m-%d') <![CDATA[ >= ]]> #{startTime} |
|
|
|
</if> |
|
|
|
<if test="endTime != null and endTime != ''"> |
|
|
|
and DATE_FORMAT(r.BIRTHDAY,'%Y-%m-%d') <![CDATA[ <= ]]> #{endTime} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectVoterRegistrationById" resultType="com.elink.esua.epdc.dto.VoterRegistrationDTO"> |
|
|
|
SELECT |
|
|
|
r.ID, |
|
|
|
r.`NAME`, |
|
|
|
r.ID_NUMBER, |
|
|
|
case r.SEX when '0' then '女' when '1' then '男' else '未知' end as sex, |
|
|
|
r.BIRTHDAY, |
|
|
|
r.MOBILE, |
|
|
|
r.NATION_NAME, |
|
|
|
r.DOMICILE, |
|
|
|
r.UPDATED_TIME, |
|
|
|
c1.CONFIG_NAME AS constituencyName, |
|
|
|
c2.CONFIG_NAME AS groupName, |
|
|
|
c3.CONFIG_NAME AS participationPrincipleName, |
|
|
|
r.REMARK |
|
|
|
FROM |
|
|
|
epdc_voter_registration r |
|
|
|
LEFT JOIN epdc_voter_registration_config c1 ON c1.CONFIG_CODE = r.CONSTITUENCY_CODE AND c1.DEL_FLAG = '0' |
|
|
|
LEFT JOIN epdc_voter_registration_config c2 ON c2.CONFIG_CODE = r.GROUP_CODE AND c2.DEL_FLAG = '0' |
|
|
|
LEFT JOIN epdc_voter_registration_config c3 ON c3.CONFIG_CODE = r.PARTICIPATION_PRINCIPLE_CODE AND c3.DEL_FLAG = '0' |
|
|
|
WHERE |
|
|
|
r.DEL_FLAG = '0' |
|
|
|
and r.ID = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|