市北互联平台后端仓库
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.

74 lines
3.0 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.IcResiCollectDao">
4 years ago
<select id="selectByAddress" parameterType="java.lang.String" resultType="com.epmet.entity.IcResiCollectEntity">
select c.id from ic_resi_collect c
4 years ago
where c.address=#{address}
and c.DEL_FLAG='0'
</select>
4 years ago
<!-- 查询采集居民信息 -->
<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>
4 years ago
<update id="updateRec" parameterType="map">
UPDATE ic_resi_collect
SET UPDATED_TIME = NOW(),
HOUSE_TYPE = #{houseType},
4 years ago
HOUSE_HOLDER_NAME = #{houseHolderName},
4 years ago
TOTAL_RESI = #{totalResi}
WHERE
id = #{id}
</update>
</mapper>