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.
84 lines
3.2 KiB
84 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.IcVolunteerPolyDao">
|
|
|
|
<resultMap type="com.epmet.entity.IcVolunteerPolyEntity" id="icVolunteerPolyMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="agencyId" column="AGENCY_ID"/>
|
|
<result property="agencyPids" column="AGENCY_PIDS"/>
|
|
<result property="name" column="NAME"/>
|
|
<result property="idCard" column="ID_CARD"/>
|
|
<result property="mobile" column="MOBILE"/>
|
|
<result property="gender" column="GENDER"/>
|
|
<result property="longitude" column="LONGITUDE"/>
|
|
<result property="latitude" column="LATITUDE"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
</resultMap>
|
|
<select id="getMapData" resultType="com.epmet.dto.result.VolunteerPolyMapDataResultDTO">
|
|
SELECT
|
|
u.id,
|
|
u.NAME,
|
|
u.mobile,
|
|
u.ID_CARD,
|
|
u.gzdw,
|
|
u.rhzk,
|
|
u.GRID_ID,
|
|
u.HOME_ID,
|
|
p.LONGITUDE,
|
|
p.LATITUDE,
|
|
c.VOLUNTEER_CATEGORY
|
|
FROM
|
|
ic_volunteer_poly p
|
|
LEFT JOIN ic_resi_user u ON p.IC_RESI_USER = u.id and u.DEL_FLAG = '0'
|
|
left join ic_volunteer_poly_category c on c.ID_CARD = p.ID_CARD and c.DEL_FLAG = '0'
|
|
<where>
|
|
p.del_flag = '0'
|
|
AND p.CUSTOMER_ID = #{customerId}
|
|
<if test="code != null and code != ''">
|
|
AND p.VOLUNTEER_CATEGORY = #{code}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getList" resultType="com.epmet.dto.result.VolunteerPolyListResultDTO">
|
|
SELECT
|
|
p.id,
|
|
p.NAME,
|
|
p.mobile,
|
|
p.user_id,
|
|
p.IC_RESI_USER,
|
|
p.ID_CARD
|
|
FROM
|
|
ic_volunteer_poly p
|
|
LEFT JOIN ic_volunteer_poly_category c ON p.ID_CARD = c.ID_CARD AND c.del_flag = '0'
|
|
WHERE
|
|
c.VOLUNTEER_CATEGORY = #{code}
|
|
AND c.CUSTOMER_ID = #{customerId}
|
|
</select>
|
|
<select id="getStatistics" resultType="com.epmet.dto.result.VolunteerPolyPieResultDTO">
|
|
SELECT
|
|
c.VOLUNTEER_CATEGORY AS CODE,
|
|
count( p.id ) AS value
|
|
FROM
|
|
ic_volunteer_poly p
|
|
LEFT JOIN ic_volunteer_poly_category c ON p.ID_CARD = c.ID_CARD
|
|
WHERE
|
|
p.CUSTOMER_ID = #{customerId} and c.VOLUNTEER_CATEGORY is not null
|
|
AND
|
|
c.VOLUNTEER_CATEGORY != ''
|
|
GROUP BY
|
|
c.VOLUNTEER_CATEGORY
|
|
</select>
|
|
<delete id="deleteDataByCustomerId">
|
|
delete from ic_volunteer_poly where CUSTOMER_ID = #{customerId}
|
|
</delete>
|
|
<delete id="deleteCategoryByCustomerId">
|
|
delete from ic_volunteer_poly_category where CUSTOMER_ID = #{customerId}
|
|
</delete>
|
|
</mapper>
|