移风店镇项目初始化
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.
 
 
 
 
 

70 lines
3.1 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.IcServiceProjectDao">
<!-- 上下架【服务项目】 -->
<update id="serviceProjectEnabled">
UPDATE ic_service_project
SET ENABLED = 1,
UPDATED_TIME = NOW()
WHERE ID IN (
<foreach collection="ids" item="id" separator=",">#{id}</foreach>
)
</update>
<!-- 查询服务项目列表 -->
<resultMap id="getServiceProjectListMap" type="com.epmet.dto.result.ServiceProjectListResultDTO">
<result column="serviceProjectId" property="serviceProjectId"/>
<result column="serviceName" property="serviceName"/>
<result column="serviceContent" property="serviceContent"/>
<result column="serviceCategoryKey" property="serviceCategoryKey"/>
<result column="policyGround" property="policyGround"/>
<result column="policyLevel" property="policyLevel"/>
<collection property="attachmentList" column="serviceProjectId" ofType="com.epmet.dto.IcServiceProjectAttachmentDTO" select="getAttachmentList"/>
</resultMap>
<select id="getServiceProjectList" resultMap="getServiceProjectListMap">
SELECT
SERVICE_NAME AS serviceName,
SERVICE_CONTENT AS serviceContent,
SERVICE_CATEGORY_KEY AS serviceCategoryKey,
ID AS serviceProjectId,
POLICY_GROUND AS policyGround,
(CASE WHEN POLICY_LEVEL = '0' THEN '市级'
WHEN POLICY_LEVEL = '0' THEN '区级'
WHEN POLICY_LEVEL = '0' THEN '街道级'
ELSE '' end) AS policyLevel
FROM ic_service_project
WHERE DEL_FLAG = 0
AND ENABLED = 0
<if test='null != serviceProjectId and serviceProjectId != "" '>
AND ID = #{serviceProjectId}
</if>
<if test='null != agencyId and agencyId != "" '>
AND AGENCY_ID = #{agencyId}
</if>
<if test='null != serviceCategoryKey and serviceCategoryKey != "" '>
AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey}
</if>
<if test='null != serviceName and serviceName != "" '>
AND SERVICE_NAME LIKE CONCAT('%',#{serviceName},'%')
</if>
<if test='null != serviceContent and serviceContent != "" '>
AND SERVICE_CONTENT LIKE CONCAT('%',#{serviceContent},'%')
</if>
<if test='null != policyGround and policyGround != "" '>
AND POLICY_GROUND LIKE CONCAT('%',#{policyGround},'%')
</if>
ORDER BY CREATED_TIME desc
</select>
<select id="getAttachmentList" resultType="com.epmet.dto.IcServiceProjectAttachmentDTO">
SELECT
ATTACHMENT_NAME,
ATTACHMENT_TYPE,
ATTACHMENT_FORMAT,
ATTACHMENT_URL
FROM ic_service_project_attachment
WHERE DEL_FLAG = '0'
AND IC_SERVICE_ID = #{serviceProjectId}
</select>
</mapper>