You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
3.1 KiB

<?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.epmet.dao.ChangeDeathDao">
<resultMap type="com.epmet.entity.ChangeDeathEntity" id="rentDeathMap">
<result property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="name" column="NAME"/>
<result property="idCard" column="ID_CARD"/>
<result property="mobile" column="MOBILE"/>
<result property="gender" column="GENDER"/>
<result property="type" column="TYPE"/>
<result property="joinDate" column="JOIN_DATE"/>
<result property="joinReason" column="JOIN_REASON"/>
<result property="removeDate" column="REMOVE_DATE"/>
<result property="removeReason" column="REMOVE_REASON"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="customerId" column="CUSTOMER_ID"/>
</resultMap>
<select id="getDeathList" resultType="com.epmet.dto.ChangeDeathDTO">
SELECT
d.*
FROM
pli_change_death d
LEFT JOIN pli_change_welfare w ON d.ID_CARD = w.ID_CARD
AND w.DEL_FLAG = '0'
WHERE
d.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="gridId != null and gridId != ''">
AND d.GRID_ID = #{gridId}
</if>
<if test="villageId != null and villageId != ''">
AND d.VILLAGE_ID = #{villageId}
</if>
<if test="buildId != null and buildId != ''">
AND d.BUILD_ID = #{buildId}
</if>
<if test="unitId != null and unitId != ''">
AND d.UNIT_ID = #{unitId}
</if>
<if test="homeId != null and homeId != ''">
AND d.HOME_ID = #{homeId}
</if>
<if test="name != null and name != ''">
AND d.NAME = #{name}
</if>
<if test="idCard != null and idCard != ''">
AND d.ID_CARD = #{idCard}
</if>
<if test="mobile != null and mobile != ''">
AND d.MOBILE = #{mobile}
</if>
<if test="startTime != null and startTime != ''">
AND d.DEATH_DATE >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND d.DEATH_DATE &lt;= #{endTime}
</if>
<if test="isWelfare != null and isWelfare != ''">
<if test="isWelfare == '0' or isWelfare == 0">
AND w.DEL_FLAG = '0'
</if>
<if test="isWelfare == '1' or isWelfare == 1">
AND w.DEL_FLAG IS NULL
</if>
</if>
order by d.CREATED_TIME desc
</select>
</mapper>