|
|
|
<?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.IcResiCollectDao">
|
|
|
|
|
|
|
|
<select id="selectByAddress" parameterType="java.lang.String" resultType="com.epmet.entity.IcResiCollectEntity">
|
|
|
|
select c.id from ic_resi_collect c
|
|
|
|
where c.address=#{address}
|
|
|
|
and c.DEL_FLAG='0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 查询采集居民信息 -->
|
|
|
|
<resultMap id="getCollectListMap" type="com.epmet.dto.result.CollectListResultDTO">
|
|
|
|
<result property="houseHolderName" column="houseHolderName"/>
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="address" column="address"/>
|
|
|
|
<result property="houseType" column="houseType"/>
|
|
|
|
<result property="totalResi" column="totalResi"/>
|
|
|
|
<collection property="list" ofType="com.epmet.dto.result.CollectListResultDTO$CollectListMemberResultDTO" column="id" select="selectMemberList"/>
|
|
|
|
</resultMap>
|
|
|
|
<select id="getCollectList" resultMap="getCollectListMap">
|
|
|
|
SELECT
|
|
|
|
c.id as id,
|
|
|
|
c.HOUSE_HOLDER_NAME AS houseHolderName,
|
|
|
|
c.ADDRESS AS address,
|
|
|
|
c.HOUSE_TYPE AS houseType,
|
|
|
|
c.TOTAL_RESI AS totalResi
|
|
|
|
FROM ic_resi_collect c
|
|
|
|
WHERE c.DEL_FLAG = 0
|
|
|
|
<if test='orgId != null and orgId != "" '>
|
|
|
|
AND CONCAT(c.PIDS,':',c.AGENCY_ID) LIKE CONCAT('%',#{orgId},'%')
|
|
|
|
</if>
|
|
|
|
<if test='neighborHoodId != null and neighborHoodId != "" '>
|
|
|
|
AND c.VILLAGE_ID = #{neighborHoodId}
|
|
|
|
</if>
|
|
|
|
<if test='buildingId != null and buildingId != "" '>
|
|
|
|
AND c.BUILD_ID = #{buildingId}
|
|
|
|
</if>
|
|
|
|
<if test='houseId != null and houseId != "" '>
|
|
|
|
AND c.HOME_ID = #{houseId}
|
|
|
|
</if>
|
|
|
|
<if test='address != null and address != "" '>
|
|
|
|
AND c.ADDRESS LIKE CONCAT('%',#{address},'%')
|
|
|
|
</if>
|
|
|
|
<if test='startDate != null and startDate != "" '>
|
|
|
|
AND DATE_FORMAT(c.CREATED_TIME,'%Y-%m-%d') >= #{startDate}
|
|
|
|
</if>
|
|
|
|
<if test='endDate != null and endDate != "" '>
|
|
|
|
AND DATE_FORMAT(c.CREATED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate}
|
|
|
|
</if>
|
|
|
|
ORDER BY c.CREATED_TIME DESC
|
|
|
|
</select>
|
|
|
|
<select id="selectMemberList" resultType="com.epmet.dto.result.CollectListResultDTO$CollectListMemberResultDTO">
|
|
|
|
select
|
|
|
|
m.`NAME` AS memberName,
|
|
|
|
m.ID_NUM AS memberIdNum,
|
|
|
|
m.MOBILE AS memberMobile,
|
|
|
|
m.HESUAN_COUNT AS heSuanCount,
|
|
|
|
m.YMJZ AS ymjz
|
|
|
|
from ic_resi_member m
|
|
|
|
where m.DEL_FLAG = 0
|
|
|
|
and m.IC_RESI_COLLECT_ID = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateRec" parameterType="map">
|
|
|
|
UPDATE ic_resi_collect
|
|
|
|
SET UPDATED_TIME = NOW(),
|
|
|
|
HOUSE_TYPE = #{houseType},
|
|
|
|
HOUSE_HOLDER_NAME = #{houseHolderName},
|
|
|
|
TOTAL_RESI = #{totalResi}
|
|
|
|
WHERE
|
|
|
|
id = #{id}
|
|
|
|
</update>
|
|
|
|
</mapper>
|