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.
 
 
 
 
 

81 lines
3.8 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.IcPublicServiceOrgDao">
<resultMap type="com.epmet.entity.IcPublicServiceOrgEntity" id="icPublicServiceOrgMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="name" column="NAME"/>
<result property="type" column="TYPE"/>
<result property="contact" column="CONTACT"/>
<result property="contactMobile" column="CONTACT_MOBILE"/>
<result property="address" column="ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="remark" column="REMARK"/>
<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"/>
</resultMap>
<resultMap id="IcPublicServiceOrgDetailResDTOMap" type="com.epmet.dto.result.IcPublicServiceOrgDetailResDTO">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="type" column="TYPE"/>
<result property="typeName" column="typeName"/>
<result property="contact" column="CONTACT"/>
<result property="contactMobile" column="CONTACT_MOBILE"/>
<result property="remark" column="REMARK"/>
<collection property="serviceMatterList" ofType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO"
select="com.epmet.dao.IcPublicServiceOrgServiceMatterDao.selectServiceMatter" column="ID">
</collection>
</resultMap>
<select id="pageList" parameterType="com.epmet.dto.form.IcPublicServiceOrgPageFormDTO" resultMap="IcPublicServiceOrgDetailResDTOMap">
SELECT
distinct o.ID,
o.`NAME`,
o.AGENCY_ID,
o.TYPE,
( CASE WHEN o.type = '1' THEN '实有单位' WHEN o.type = '2' THEN '社会服务组织' WHEN o.type = '3' THEN '志愿团队' end) AS typeName,
o.CONTACT,
o.CONTACT_MOBILE,
o.REMARK
FROM
ic_public_service_org o
LEFT JOIN ic_public_service_org_service_matter m ON ( o.id = m.ORG_ID and m.del_flag='0')
LEFT JOIN ic_service_item_dict d ON ( m.CATEGORY_ID = d.ID and m.CUSTOMER_ID=d.CUSTOMER_ID)
WHERE
o.DEL_FLAG = '0'
and o.CUSTOMER_ID=#{customerId}
<if test='null != agencyId and "" != agencyId'>
AND ( o.AGENCY_ID = #{agencyId} OR o.PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test='null != name and "" != name'>
AND o.`NAME` LIKE concat( '%', #{name}, '%' )
</if>
<if test="null != categoryIds and categoryIds.size() > 0">
<foreach collection="categoryIds" item="categoryId" open="AND" separator="" close="">
m.CATEGORY_ID = #{categoryId}
</foreach>
</if>
<if test='null != type and "" != type'>
AND o.TYPE = #{type}
</if>
<if test='null != contact and "" != contact'>
AND o.CONTACT LIKE concat( '%', #{contact}, '%' )
</if>
<if test='null != contactMobile and "" != contactMobile'>
AND o.CONTACT_MOBILE like concat( '%', #{contactMobile}, '%' )
</if>
ORDER BY
o.CREATED_TIME DESC
</select>
</mapper>