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.
 
 
 
 
 

87 lines
3.2 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.id,
u.id AS userId,
u.id as icResiUserId,
d.GRID_ID,
u.`NAME`,
d.ID_CARD,
u.MOBILE,
u.GENDER,
d.TYPE,
d.DEATH_DATE,
d.JOIN_DATE,
d.JOIN_REASON,
d.REMOVE_DATE,
d.REMOVE_REASON,
d.CREATED_TIME,
d.UPDATED_TIME
FROM
pli_change_death d
LEFT JOIN ic_resi_user u
ON (u.ID_CARD = d.ID_CARD
and u.DEL_FLAG='0'
and d.CUSTOMER_ID=u.CUSTOMER_ID)
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}
AND u.CUSTOMER_ID = #{customerId}
</if>
<if test="gridId != null and gridId != ''">
AND d.GRID_ID = #{gridId}
</if>
<if test="name != null and name != ''">
AND d.NAME like concat( '%',#{name},'%')
</if>
<if test="idCard != null and idCard != ''">
AND d.ID_CARD like concat('%', #{idCard},'%')
</if>
<if test="mobile != null and mobile != ''">
AND d.MOBILE like concat('%', #{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>