<?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.sinata.system.mapper.MwProtectionRegulationMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.sinata.system.domain.MwProtectionRegulation">
|
<id column="ID" property="id" />
|
<result column="DEL_FLAG" property="delFlag" />
|
<result column="CREATE_BY" property="createBy" />
|
<result column="CREATE_TIME" property="createTime" />
|
<result column="UPDATE_BY" property="updateBy" />
|
<result column="UPDATE_TIME" property="updateTime" />
|
<result column="DEPARTMENT_ID" property="departmentId" />
|
<result column="PROTECTION_REGULATION_TYPE" property="protectionRegulationType" />
|
<result column="PROTECTION_REGULATION_TYPE_STR" property="protectionRegulationTypeStr" />
|
<result column="REGULATION_NAME" property="regulationName" />
|
<result column="ATTACHMENT" property="attachment" />
|
<result column="REMARK" property="remark" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
DEL_FLAG,
|
CREATE_BY,
|
CREATE_TIME,
|
UPDATE_BY,
|
UPDATE_TIME,
|
ID, DEPARTMENT_ID, PROTECTION_REGULATION_TYPE, PROTECTION_REGULATION_TYPE_STR, REGULATION_NAME, ATTACHMENT, REMARK
|
</sql>
|
<select id="pageList" resultType="com.sinata.system.domain.vo.MwProtectionRegulationVO">
|
SELECT MPR.ID,
|
MPR.DEPARTMENT_ID,
|
MPR.PROTECTION_REGULATION_TYPE,
|
MPR.PROTECTION_REGULATION_TYPE_STR,
|
MPR.REGULATION_NAME,
|
MPR.REMARK,
|
MPR.CREATE_TIME,
|
SD.DEPARTMENT_NAME,
|
LISTAGG(MA.FILE_NAME, ',') WITHIN GROUP (ORDER BY MA.FILE_NAME) AS fileName
|
FROM MW_PROTECTION_REQULATION MPR
|
LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MPR.DEPARTMENT_ID
|
LEFT JOIN (SELECT * FROM MW_ATTACHMENT WHERE "TYPE" = 3) MA ON MA.TARGET_ID = MPR.ID
|
<where>
|
MPR.DEL_FLAG= 0
|
<if test="treeCode != null and treeCode != ''">
|
AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%')
|
</if>
|
<if test="query.protectionRegulationType != null">
|
AND MPR.PROTECTION_REGULATION_TYPE = #{query.protectionRegulationType}
|
</if>
|
<if test="query.regulationName != null and query.regulationName != ''">
|
AND MPR.REGULATION_NAME LIKE CONCAT('%',#{query.regulationName},'%')
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|