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.
563 lines
20 KiB
563 lines
20 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.IcResiUserDao">
|
|
|
|
<insert id="add">
|
|
insert into ${tableName}
|
|
(
|
|
<foreach collection="map.entrySet()" index="key" item="value" separator=",">
|
|
${key}
|
|
</foreach>
|
|
,DEL_FLAG
|
|
,REVISION
|
|
,CREATED_TIME
|
|
,UPDATED_TIME
|
|
) values
|
|
(
|
|
<foreach collection="map.entrySet()" index="key" item="value" separator=",">
|
|
#{value}
|
|
</foreach>
|
|
,'0'
|
|
,'0'
|
|
,NOW()
|
|
,NOW()
|
|
)
|
|
</insert>
|
|
|
|
<update id="upTable">
|
|
UPDATE ${tableName}
|
|
SET
|
|
<foreach collection="map.entrySet()" index="key" item="value" separator=",">
|
|
${key} = #{value}
|
|
</foreach>
|
|
,UPDATED_TIME = NOW()
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<select id="selectListMapById" parameterType="map" resultType="map">
|
|
select * from ic_resi_user where del_flag='0' and id=#{icResiUserId} and customer_id=#{customerId}
|
|
</select>
|
|
|
|
<select id="selectSubTableRecords" parameterType="map" resultType="map">
|
|
select * from ${subTableName} where del_flag='0' and IC_RESI_USER=#{icResiUserId} and customer_id=#{customerId}
|
|
</select>
|
|
|
|
<!-- 列表查询 -->
|
|
<sql id="listWhereForPage">
|
|
ic_resi_user.DEL_FLAG = '0'
|
|
<!--如果查询的left表则不显示空的数据-->
|
|
<if test="resultTableName != null and resultTableName != ''">
|
|
AND ${resultTableName}.ID IS NOT NULL
|
|
</if>
|
|
and ic_resi_user.customer_id=#{customerId}
|
|
and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%'))
|
|
<if test="null != conditions and conditions.size() > 0">
|
|
<foreach item="subCondition" collection="conditions" open="" separator="" close="">
|
|
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0">
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'equal' ">
|
|
<if test="null!=subCondition.columnValue[0] and ''!=subCondition.columnValue[0]">
|
|
and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]}
|
|
</if>
|
|
</if>
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'like' ">
|
|
<if test="null!=subCondition.columnValue[0] and ''!=subCondition.columnValue[0]">
|
|
and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%')
|
|
</if>
|
|
</if>
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' ">
|
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]}
|
|
</if>
|
|
</if>
|
|
</foreach>
|
|
</if>
|
|
</sql>
|
|
|
|
<!-- 导出公用where条件 -->
|
|
<sql id="listWhere">
|
|
ic_resi_user.DEL_FLAG = '0'
|
|
and ic_resi_user.customer_id=#{customerId}
|
|
<if test="null != conditions and conditions.size() > 0">
|
|
<foreach item="subCondition" collection="conditions" open="" separator="" close="">
|
|
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0">
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'equal' ">
|
|
<if test="null!=subCondition.columnValue[0] and ''!=subCondition.columnValue[0]">
|
|
and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]}
|
|
</if>
|
|
</if>
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'like' ">
|
|
<if test="null!=subCondition.columnValue[0] and ''!=subCondition.columnValue[0]">
|
|
and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%')
|
|
</if>
|
|
</if>
|
|
|
|
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' ">
|
|
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]}
|
|
</if>
|
|
</if>
|
|
</foreach>
|
|
</if>
|
|
</sql>
|
|
|
|
<!-- 查询列表用 -->
|
|
<select id="selectListResiMap" parameterType="map" resultType="map">
|
|
select
|
|
ic_resi_user.id as icResiUserId,
|
|
ic_resi_user.AGENCY_ID as ORG_ID,
|
|
<foreach item="column" collection="resultColumns" open="" separator="," close="">
|
|
${column.columnName}
|
|
</foreach>
|
|
FROM
|
|
ic_resi_user
|
|
<if test="null != subTables and subTables.size() > 0">
|
|
<foreach item="subTableName" collection="subTables" open="" separator="" close="">
|
|
${subTableName}
|
|
</foreach>
|
|
</if>
|
|
<where>
|
|
<include refid="listWhereForPage"></include>
|
|
<if test="keyword != null and keyword != ''">
|
|
AND (
|
|
NAME = #{keyword}
|
|
or MOBILE = #{keyword}
|
|
or ID_CARD = #{keyword}
|
|
)
|
|
</if>
|
|
</where>
|
|
group by IC_RESI_USER.id
|
|
order by ic_resi_user.CREATED_TIME desc
|
|
</select>
|
|
|
|
<update id="updateToDel" parameterType="java.lang.String">
|
|
update ic_resi_user set del_flag='1' where id=#{icResiUserId}
|
|
</update>
|
|
|
|
<update id="updateSubTableToDel" parameterType="map">
|
|
update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId}
|
|
</update>
|
|
|
|
<select id="dynamicQuery" parameterType="map" resultType="map">
|
|
select
|
|
${resultTableName}.*
|
|
FROM
|
|
ic_resi_user
|
|
<if test="null != subTables and subTables.size() > 0">
|
|
<foreach item="subTableName" collection="subTables" open="" separator="" close="">
|
|
${subTableName}
|
|
</foreach>
|
|
</if>
|
|
|
|
<where>
|
|
<include refid="listWhereForPage"></include>
|
|
</where>
|
|
group by IC_RESI_USER.id
|
|
order by ic_resi_user.CREATED_TIME desc
|
|
</select>
|
|
|
|
<!-- 查询个人信息 -->
|
|
<resultMap id="selectPersonData" type="com.epmet.dto.result.PersonDataResultDTO">
|
|
<result column="GZDW" property="workUnit"/>
|
|
<result column="ID_CARD" property="idCard"/>
|
|
<result column="name" property="name"/>
|
|
<result column="isVolunteer" property="isVolunteer"/>
|
|
<result column="CUSTOMER_ID" property="customerId"/>
|
|
<result column="GRID_ID" property="gridId"/>
|
|
<collection property="financialSituation" ofType="com.epmet.dto.FinancialSituationDTO">
|
|
<result column="YSR" property="monthlyIncome"/>
|
|
<result column="TXJE" property="retirementAmount"/>
|
|
</collection>
|
|
</resultMap>
|
|
<select id="personData" resultMap="selectPersonData">
|
|
SELECT
|
|
GZDW,
|
|
name,
|
|
YSR,
|
|
TXJE,
|
|
ID_CARD,
|
|
IFNULL(IS_VOLUNTEER,'0') AS isVolunteer,
|
|
CUSTOMER_ID,
|
|
GRID_ID
|
|
FROM ic_resi_user
|
|
WHERE DEL_FLAG = '0'
|
|
AND ID = #{userId}
|
|
</select>
|
|
|
|
<!-- 根据名字,组织查询人 -->
|
|
<select id="searchByName" resultType="com.epmet.dto.result.SearchByNameResultDTO">
|
|
SELECT
|
|
ID AS userId,
|
|
`NAME`,
|
|
VILLAGE_ID AS neighborHoodId,
|
|
BUILD_ID,
|
|
GRID_ID
|
|
FROM ic_resi_user
|
|
WHERE DEL_FLAG = '0'
|
|
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE CONCAT('%',#{agencyId},'%'))
|
|
AND `NAME` LIKE CONCAT('%',#{name},'%')
|
|
ORDER BY `NAME`
|
|
</select>
|
|
|
|
<select id="selectUserDemandCode" parameterType="java.lang.String" resultType="java.lang.String">
|
|
SELECT DISTINCT
|
|
m.CATEGORY_CODE
|
|
FROM
|
|
ic_resi_demand m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.IC_RESI_USER = #{icResiUserId}
|
|
ORDER BY
|
|
m.CREATED_TIME ASC
|
|
</select>
|
|
|
|
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
|
|
SELECT
|
|
GROUP_CONCAT(m.CATEGORY_NAME)
|
|
FROM
|
|
ic_resi_demand_dict m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.CUSTOMER_ID = #{customerId}
|
|
<if test="null != codeSet and codeSet.size() > 0">
|
|
AND m.CATEGORY_CODE IN
|
|
<foreach item="code" collection="codeSet" open="(" separator="," close=")">
|
|
#{code}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
<select id="getHomeUserCategoryCount" resultType="java.util.Map">
|
|
SELECT
|
|
HOME_ID,
|
|
SUM(IF('1' = IS_PARTY, 1, 0)) AS IS_PARTY,
|
|
SUM(IF('1' = IS_DBH, 1, 0)) AS IS_DBH,
|
|
SUM(IF('1' = IS_ENSURE_HOUSE, 1, 0)) AS IS_ENSURE_HOUSE,
|
|
SUM(IF('1' = IS_UNEMPLOYED, 1, 0)) AS IS_UNEMPLOYED,
|
|
SUM(IF('1' = IS_YLFN, 1, 0)) AS IS_YLFN,
|
|
SUM(IF('1' = IS_VETERANS, 1, 0)) AS IS_VETERANS,
|
|
SUM(IF('1' = IS_UNITED_FRONT, 1, 0)) AS IS_UNITED_FRONT,
|
|
SUM(IF('1' = IS_XFRY, 1, 0)) AS IS_XFRY,
|
|
SUM(IF('1' = IS_VOLUNTEER, 1, 0)) AS IS_VOLUNTEER,
|
|
SUM(IF('1' = IS_OLD_PEOPLE, 1, 0)) AS IS_OLD_PEOPLE,
|
|
SUM(IF('1' = IS_KC, 1, 0)) AS IS_KC,
|
|
SUM(IF('1' = IS_SD, 1, 0)) AS IS_SD,
|
|
SUM(IF('1' = IS_SN, 1, 0)) AS IS_SN,
|
|
SUM(IF('1' = IS_SZ, 1, 0)) AS IS_SZ,
|
|
SUM(IF('1' = IS_CJ, 1, 0)) AS IS_CJ,
|
|
SUM(IF('1' = IS_DB, 1, 0)) AS IS_DB,
|
|
SUM(IF('1' = IS_MB, 1, 0)) AS IS_MB,
|
|
SUM(IF('1' = IS_SPECIAL, 1, 0)) AS IS_SPECIAL
|
|
FROM ic_resi_user
|
|
WHERE DEL_FLAG = 0
|
|
AND BUILD_ID = #{buildId}
|
|
GROUP BY HOME_ID
|
|
</select>
|
|
|
|
<!-- 根据userId查询志愿者 -->
|
|
<select id="selectVolunteerByUserId" resultType="java.lang.String">
|
|
SELECT VOLUNTEER_CATEGORY FROM ic_volunteer WHERE DEL_FLAG = '0' AND ic_resi_user = #{userId}
|
|
</select>
|
|
|
|
<!-- 查询人员类别 -->
|
|
<select id="selectPersonType" resultType="java.util.Map">
|
|
select
|
|
<foreach collection="columns" separator="," item="c">
|
|
IFNULL(`${c}`,'0') AS `${c}`
|
|
</foreach>
|
|
from ${tableName}
|
|
where DEL_FLAG = '0'
|
|
AND CUSTOMER_ID = #{customerId}
|
|
<if test=' tableName == "ic_resi_user" '>
|
|
AND ID = #{userId}
|
|
</if>
|
|
<if test=' tableName != "ic_resi_user" '>
|
|
AND IC_RESI_USER = #{userId}
|
|
</if>
|
|
</select>
|
|
<select id="getResiUser" resultType="com.epmet.dto.IcResiUserDTO">
|
|
SELECT
|
|
id,
|
|
`name`,
|
|
id_card,
|
|
mobile
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
del_flag = '0'
|
|
AND customer_id = #{customerId}
|
|
AND id_card = #{idCard}
|
|
</select>
|
|
|
|
|
|
<select id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO">
|
|
SELECT
|
|
ir.id as demandUserId,
|
|
IFNULL(ir.`NAME`,'') AS demandUserName,
|
|
IFNULL(ir.MOBILE,'') AS demandUserMobile,
|
|
concat(ir.`NAME`,'(',ir.MOBILE,')')as label,
|
|
ir.grid_id as gridId,
|
|
ir.ID_CARD as idCard
|
|
FROM
|
|
ic_resi_user ir
|
|
WHERE
|
|
ir.DEL_FLAG = '0'
|
|
AND ir.AGENCY_ID = #{agencyId}
|
|
<if test="gridId != null and gridId != ''">
|
|
AND ir.GRID_ID = #{gridId}
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
AND ir.`NAME` concat('%',#{name},'%')
|
|
</if>
|
|
ORDER BY
|
|
CONVERT ( ir.NAME USING gbk ) ASC
|
|
</select>
|
|
|
|
<select id="selectIdByIdCard" parameterType="map" resultType="com.epmet.dto.IcResiUserDTO">
|
|
select
|
|
ir.*
|
|
FROM
|
|
ic_resi_user ir
|
|
WHERE
|
|
ir.DEL_FLAG = '0'
|
|
and ir.customer_id=#{customerId}
|
|
<if test="idNum != null and idNum != ''">
|
|
and ir.ID_CARD=#{idNum}
|
|
</if>
|
|
<if test="icResiUserId != null and icResiUserId != ''">
|
|
and ir.id=#{icResiUserId}
|
|
</if>
|
|
</select>
|
|
|
|
<resultMap id="IcResiUserBriefDTOMap" type="com.epmet.dto.result.IcResiUserBriefDTO">
|
|
<id property="icResiUserId" column="ID" ></id>
|
|
<result property="houseId" column="HOME_ID"/>
|
|
<result property="icUserName" column="NAME"/>
|
|
<collection property="houseUserList" ofType="com.epmet.dto.result.HouseUserDTO"
|
|
column="{currentIcResiUserId=ID,homeId=HOME_ID}" select="com.epmet.dao.IcResiUserDao.selectListFamilyMember">
|
|
</collection>
|
|
</resultMap>
|
|
|
|
|
|
<!-- 查询当前居民的姓名,和房屋id -->
|
|
<select id="selectIcResuUser" parameterType="map" resultMap="IcResiUserBriefDTOMap">
|
|
SELECT
|
|
m.ID,
|
|
m.HOME_ID,
|
|
m.`NAME`
|
|
FROM
|
|
ic_resi_user m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.id = #{isResiUserId}
|
|
</select>
|
|
|
|
<!-- 除了本人以外,住在这个房子的人 -->
|
|
<select id="selectListFamilyMember" parameterType="map" resultType="com.epmet.dto.result.HouseUserDTO">
|
|
SELECT
|
|
m.ID AS icResiUserId,
|
|
m.`NAME` AS icUserName
|
|
FROM
|
|
ic_resi_user m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.id != #{currentIcResiUserId}
|
|
and m.HOME_ID=#{homeId}
|
|
order by m.CREATED_TIME asc
|
|
</select>
|
|
<select id="getPartyMemberAgeStatistics" resultType="com.epmet.commons.tools.dto.result.OptionDataResultDTO">
|
|
SELECT
|
|
ageGroup AS "code",
|
|
COUNT(ID) AS "value"
|
|
FROM
|
|
(
|
|
SELECT
|
|
ID,
|
|
CASE
|
|
WHEN age < 50 THEN '0'
|
|
WHEN age >= 50 AND age <= 59 THEN '1'
|
|
WHEN age >= 60 AND age <= 69 THEN '2'
|
|
WHEN age >= 70 AND age <= 79 THEN '3'
|
|
ELSE '4'
|
|
END AS ageGroup
|
|
FROM
|
|
(
|
|
SELECT
|
|
ID,
|
|
YEAR (FROM_DAYS(DATEDIFF(NOW(),SUBSTRING( ID_CARD, 7, 8 )))) AS age
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND IS_PARTY = '1'
|
|
<choose>
|
|
<when test='orgType == "grid"'>
|
|
AND GRID_ID = #{orgId}
|
|
</when>
|
|
<otherwise>
|
|
AND (AGENCY_ID = #{orgId} OR PIDS LIKE CONCAT('%',#{orgId},'%'))
|
|
</otherwise>
|
|
</choose>
|
|
) a
|
|
) a
|
|
GROUP BY ageGroup
|
|
</select>
|
|
<select id="getPartyMemberAgeList" resultType="com.epmet.dto.result.PartyMemberAgeResultDTO">
|
|
SELECT
|
|
ID AS "userId",
|
|
NAME,
|
|
MOBILE,
|
|
age
|
|
FROM
|
|
(
|
|
SELECT
|
|
ID,
|
|
NAME,
|
|
MOBILE,
|
|
age,
|
|
CASE
|
|
WHEN age < 50 THEN '0'
|
|
WHEN age >= 50 AND age <= 59 THEN '1'
|
|
WHEN age >= 60 AND age <= 69 THEN '2'
|
|
WHEN age >= 70 AND age <= 79 THEN '3'
|
|
ELSE '4'
|
|
END AS ageGroup
|
|
FROM
|
|
(
|
|
SELECT
|
|
ID,
|
|
NAME,
|
|
MOBILE,
|
|
YEAR (FROM_DAYS(DATEDIFF(NOW(),SUBSTRING( ID_CARD, 7, 8 )))) AS age
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND IS_PARTY = '1'
|
|
<choose>
|
|
<when test='orgType == "grid"'>
|
|
AND GRID_ID = #{orgId}
|
|
</when>
|
|
<otherwise>
|
|
AND (AGENCY_ID = #{orgId} OR PIDS LIKE CONCAT('%',#{orgId},'%'))
|
|
</otherwise>
|
|
</choose>
|
|
) a
|
|
) a
|
|
<if test="null != code and '' != code">
|
|
WHERE ageGroup = #{code}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getPartyMemberEducationList" resultType="com.epmet.dto.result.PartyMemberEducationResultDTO">
|
|
SELECT
|
|
ID AS "userId",
|
|
NAME,
|
|
MOBILE,
|
|
CULTURE AS education
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND IS_PARTY = '1'
|
|
AND CULTURE IS NOT NULL
|
|
<if test="null != code and '' != code">
|
|
AND CULTURE = #{code}
|
|
</if>
|
|
<choose>
|
|
<when test='orgType == "grid"'>
|
|
AND GRID_ID = #{orgId}
|
|
</when>
|
|
<otherwise>
|
|
AND (AGENCY_ID = #{orgId} OR PIDS LIKE CONCAT('%',#{orgId},'%'))
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
<select id="getPartyMemberEducationStatistics" resultType="com.epmet.commons.tools.dto.result.OptionDataResultDTO">
|
|
SELECT
|
|
CULTURE AS "code",
|
|
count(ID) AS "value"
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND IS_PARTY = '1'
|
|
AND CULTURE IS NOT NULL
|
|
<choose>
|
|
<when test='orgType == "grid"'>
|
|
AND GRID_ID = #{orgId}
|
|
</when>
|
|
<otherwise>
|
|
AND (AGENCY_ID = #{orgId} OR PIDS LIKE CONCAT('%',#{orgId},'%'))
|
|
</otherwise>
|
|
</choose>
|
|
GROUP BY CULTURE
|
|
</select>
|
|
|
|
<select id="listIcResiInfosByUserIds"
|
|
resultType="com.epmet.dto.result.VolunteerDistributionResultDTO$Distribution">
|
|
select userbaseinfo.USER_ID as epmetUserId,
|
|
icuser.ID as icResiUserId,
|
|
icuser.BUILD_ID as buildingId,
|
|
icvol.VOLUNTEER_CATEGORY as volunteerCategoriesStr
|
|
from user_base_info userbaseinfo
|
|
inner join ic_resi_user icuser on (userbaseinfo.ID_NUM = icuser.ID_CARD and icuser.DEL_FLAG = '0')
|
|
inner join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0')
|
|
where userbaseinfo.DEL_FLAG = '0'
|
|
and userbaseinfo.ID_NUM is not null
|
|
and userbaseinfo.USER_ID in
|
|
<foreach collection="userIds" open="(" separator="," close=")" item="userId">
|
|
#{userId}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getCategoryListMap" resultType="java.util.Map">
|
|
SELECT
|
|
IFNULL(is_kc,'0') IS_KC,
|
|
IFNULL(is_cj,'0') IS_CJ,
|
|
IFNULL(is_ylfn,'0') IS_YLFN,
|
|
IFNULL(is_sn,'0') IS_SN,
|
|
IFNULL(is_special,'0') IS_SPECIAL,
|
|
IFNULL(is_volunteer,'0') IS_VOLUNTEER,
|
|
IFNULL(is_unemployed,'0') IS_UNEMPLOYED,
|
|
IFNULL(is_mb,'0') IS_MB,
|
|
IFNULL(is_sz,'0') IS_SZ,
|
|
IFNULL(is_sd,'0') IS_SD,
|
|
IFNULL(is_veterans,'0') IS_VETERANS,
|
|
IFNULL(is_ensure_house,'0') IS_ENSURE_HOUSE,
|
|
IFNULL(is_party,'0') IS_PARTY,
|
|
IFNULL(is_old_people,'0') IS_OLD_PEOPLE,
|
|
IFNULL(is_xfry,'0')IS_XFRY,
|
|
IFNULL(is_united_front,'0') IS_UNITED_FRONT,
|
|
IFNULL(is_db,'0') IS_DB,
|
|
IFNULL(is_dbh,'0') IS_DBH
|
|
FROM
|
|
ic_resi_user
|
|
WHERE
|
|
del_flag = '0'
|
|
AND id = #{icUserId}
|
|
</select>
|
|
<select id="selectResiUsers" resultType="java.util.Map">
|
|
SELECT
|
|
ID AS userId,
|
|
GRID_ID AS gridId,
|
|
HOME_ID AS homeId,
|
|
`NAME` AS name,
|
|
MOBILE AS mobile,
|
|
<foreach collection="types" item="t" separator=",">
|
|
${t}
|
|
</foreach>
|
|
FROM ic_resi_user
|
|
WHERE DEL_FLAG = 0
|
|
AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{orgId},'%')
|
|
AND(
|
|
<foreach collection="types" item="t" separator="OR">
|
|
(${t} IS NOT NULL AND ${t} != 0)
|
|
</foreach>)
|
|
ORDER BY CREATED_TIME DESC
|
|
</select>
|
|
|
|
</mapper>
|
|
|