|
|
@ -5,74 +5,74 @@ |
|
|
|
|
|
|
|
<select id="selectMoveInList" resultType="com.epmet.dto.result.IcMoveInListResultDTO"> |
|
|
|
SELECT |
|
|
|
id moveInId, |
|
|
|
grid_id gridId, |
|
|
|
village_id villageId, |
|
|
|
build_id buildId, |
|
|
|
unit_id unitId, |
|
|
|
home_id homeId, |
|
|
|
name NAME, |
|
|
|
is_welfare isWeifare, |
|
|
|
is_check isCheck, |
|
|
|
mobile mobile, |
|
|
|
id_card idCard, |
|
|
|
gender gender, |
|
|
|
IF(gender='1','男',IF(gender='2','女','未知'))genderName, |
|
|
|
age age, |
|
|
|
in_time inTime, |
|
|
|
in_reason inReason, |
|
|
|
source_address_code sourceAddressCode, |
|
|
|
source_address_path_code sourceAddressPathCode, |
|
|
|
source_address sourceAddress, |
|
|
|
address address, |
|
|
|
move_number moveNumber, |
|
|
|
householder_name householderName, |
|
|
|
householder_relation householderRelation |
|
|
|
FROM |
|
|
|
ic_move_in_record |
|
|
|
WHERE |
|
|
|
del_flag = '0' |
|
|
|
AND customer_id=#{customerId} |
|
|
|
iru.ID as icResiUserId, |
|
|
|
mir.id moveInId, |
|
|
|
mir.grid_id gridId, |
|
|
|
mir.village_id villageId, |
|
|
|
mir.build_id buildId, |
|
|
|
mir.unit_id unitId, |
|
|
|
mir.home_id homeId, |
|
|
|
mir.name NAME, |
|
|
|
mir.is_welfare isWeifare, |
|
|
|
mir.is_check isCheck, |
|
|
|
mir.mobile mobile, |
|
|
|
mir.id_card idCard, |
|
|
|
mir.gender gender, |
|
|
|
IF(mir.gender='1','男',IF(mir.gender='2','女','未知'))genderName, |
|
|
|
mir.age age, |
|
|
|
mir.in_time inTime, |
|
|
|
mir.in_reason inReason, |
|
|
|
mir.source_address_code sourceAddressCode, |
|
|
|
mir.source_address_path_code sourceAddressPathCode, |
|
|
|
mir.source_address sourceAddress, |
|
|
|
mir.address address, |
|
|
|
mir.move_number moveNumber, |
|
|
|
mir.householder_name householderName, |
|
|
|
mir.householder_relation householderRelation |
|
|
|
FROM ic_move_in_record mir |
|
|
|
left join ic_resi_user iru on iru.ID_CARD = mir.ID_CARD and iru.DEL_FLAG = 0 |
|
|
|
WHERE mir.del_flag = '0' |
|
|
|
AND mir.customer_id=#{customerId} |
|
|
|
<if test="gridId != null and gridId != '' "> |
|
|
|
AND grid_id = #{gridId} |
|
|
|
AND mir.grid_id = #{gridId} |
|
|
|
</if> |
|
|
|
<if test="villageId != null and villageId != '' "> |
|
|
|
AND village_id = #{villageId} |
|
|
|
AND mir.village_id = #{villageId} |
|
|
|
</if> |
|
|
|
<if test="buildId != null and buildId != '' "> |
|
|
|
AND build_id = #{buildId} |
|
|
|
AND mir.build_id = #{buildId} |
|
|
|
</if> |
|
|
|
<if test="unitId != null and unitId != '' "> |
|
|
|
AND unit_id = #{unitId} |
|
|
|
AND mir.unit_id = #{unitId} |
|
|
|
</if> |
|
|
|
<if test="homeId != null and homeId != '' "> |
|
|
|
AND home_id = #{homeId} |
|
|
|
AND mir.home_id = #{homeId} |
|
|
|
</if> |
|
|
|
<if test="name != null and name != '' "> |
|
|
|
AND `name` LIKE CONCAT('%', #{name}, '%') |
|
|
|
AND mir.name LIKE CONCAT('%', #{name}, '%') |
|
|
|
</if> |
|
|
|
<if test="mobile != null and mobile != '' "> |
|
|
|
AND mobile = #{mobile} |
|
|
|
AND mir.mobile = #{mobile} |
|
|
|
</if> |
|
|
|
<if test="idCard != null and idCard != '' "> |
|
|
|
AND id_card = #{idCard} |
|
|
|
AND mir.id_card = #{idCard} |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != '' "> |
|
|
|
AND DATE_FORMAT(in_time,"%Y-%m-%d") <![CDATA[>=]]> #{startTime} |
|
|
|
AND DATE_FORMAT(mir.in_time,"%Y-%m-%d") <![CDATA[>=]]> #{startTime} |
|
|
|
</if> |
|
|
|
<if test="endTime != null and endTime != '' "> |
|
|
|
AND DATE_FORMAT(in_time,"%Y-%m-%d") <![CDATA[<=]]> #{endTime} |
|
|
|
AND DATE_FORMAT(mir.in_time,"%Y-%m-%d") <![CDATA[<=]]> #{endTime} |
|
|
|
</if> |
|
|
|
<if test="isWeifare != null and isWeifare != '' "> |
|
|
|
AND is_welfare = #{isWeifare} |
|
|
|
AND mir.is_welfare = #{isWeifare} |
|
|
|
</if> |
|
|
|
<if test="moveInId != null and moveInId != '' "> |
|
|
|
AND id = #{moveInId} |
|
|
|
AND mir.id = #{moveInId} |
|
|
|
</if> |
|
|
|
<if test="agencyId != null and agencyId != '' "> |
|
|
|
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE CONCAT('%',#{agencyId},'%')) |
|
|
|
AND (mir.AGENCY_ID = #{agencyId} OR mir.PIDS LIKE CONCAT('%',#{agencyId},'%')) |
|
|
|
</if> |
|
|
|
ORDER BY created_time DESC |
|
|
|
ORDER BY mir.created_time DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |
|
|
|