日照智慧社区接口服务
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.
 
 
 
 
 

95 lines
3.3 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.ChangeWelfareDao">
<resultMap type="com.epmet.entity.ChangeWelfareEntity" id="changeWelfareMap">
<result property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="gridId" column="GRID_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="getWelfareList" resultType="com.epmet.dto.ChangeWelfareDTO">
SELECT
w.id,
u.id AS userId,
w.GRID_ID,
u.`NAME`,
w.ID_CARD,
u.MOBILE,
u.GENDER,
w.TYPE,
w.JOIN_DATE,
w.JOIN_REASON,
w.REMOVE_DATE,
w.REMOVE_REASON,
w.CREATED_TIME,
w.UPDATED_TIME
FROM
pli_change_welfare w
LEFT JOIN ic_resi_user u ON u.ID_CARD = w.ID_CARD
WHERE
w.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND w.CUSTOMER_ID = #{customerId}
AND u.CUSTOMER_ID = #{customerId}
</if>
<if test="gridId != null and gridId != ''">
AND w.GRID_ID = #{gridId}
</if>
<if test="name != null and name != ''">
AND w.NAME = #{name}
</if>
<if test="idCard != null and idCard != ''">
AND w.ID_CARD = #{idCard}
</if>
<if test="mobile != null and mobile != ''">
AND w.MOBILE = #{mobile}
</if>
<if test="startTime != null and startTime != ''">
AND w.JOIN_DATE >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND w.JOIN_DATE &lt;= #{endTime}
</if>
order by w.CREATED_TIME desc
</select>
<select id="selectByIdCard" resultType="com.epmet.entity.ChangeWelfareEntity">
select * from pli_change_welfare
where ID_CARD=#{idCard}
and del_flag='0'
</select>
<update id="removeWelfare">
update pli_change_welfare
set REMOVE_DATE=#{removeDate},
REMOVE_REASON=#{removeReason},
del_flag='1'
where del_flag='0'
<if test="id != null and id != ''">
AND ID = #{id}
</if>
<if test="idCard != null and idCard != ''">
AND ID_CARD = #{idCard}
</if>
</update>
</mapper>