Files
foton-slrs-system-rest/adc-da-slrs/src/main/resources/mybatis/mapper/msgDynamicInfo/MsgDynamicInfoEOMapper.xml
T
2021-11-09 14:52:51 +08:00

565 lines
24 KiB
XML

<?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.adc.da.slrs.msgDynamicInfo.dao.MsgDynamicInfoEODao" >
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO" >
<id column="id" property="id" />
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="valid_flag" property="validFlag" />
<result column="pub_org" property="pubOrg" />
<result column="pub_user" property="pubUser" />
<result column="pub_time" property="pubTime" />
<result column="link_uri" property="linkUri" />
<result column="content" property="content" jdbcType="LONGVARBINARY"/>
<result column="content_text" property="contentText" jdbcType="CLOB" javaType = "java.lang.String" />
<result column="title" property="title" />
<result column="msg_mode" property="msgMode" />
<result column="msg_type" property="msgType" />
<result column="is_pic_msg" property="isPicMsg" />
<result column="pubUserName" property="pubUserName" />
<result column="pubOrgName" property="pubOrgName" />
<result column="moduleName" property="moduleName" />
<result column="attPicIds" property="attPicIds" />
<result column="save_status" property="saveStatus" />
<result column="save_level" property="saveLevel" />
<result column="relevent_stand" property="releventStand" />
<result column="relevent_laws" property="releventLaws" />
<result column="relevent_group" property="releventGroup" />
<result column="data_text" property="dataText" />
<result column="source" property="source" />
</resultMap>
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.msgDynamicInfo.dto.MsgDynamicInfoExportDto" >
<result column="pub_org" property="pubOrg" />
<result column="pub_user" property="pubUser" />
<result column="pub_time" property="pubTime" />
<result column="link_uri" property="linkUri" />
<result column="content" property="content" jdbcType="LONGVARBINARY"/>
<result column="title" property="title" />
<result column="msg_mode" property="msgMode" />
<result column="msg_type" property="msgType" />
<result column="relevent_stand" property="releventStand" />
<result column="relevent_laws" property="releventLaws" />
<result column="DATA_TEXT" property="msgType" />
<result column="SAVE_LEVEL" property="msgType" />
</resultMap>
<!-- MSG_DYNAMIC_INFO table all fields -->
<sql id="Base_Column_List" >
is_pic_msg,modify_time, creation_time, valid_flag, pub_org, pub_user, pub_time, link_uri, title, msg_mode,
msg_type, id, content,content_text,save_status,save_level,relevent_stand,relevent_laws,data_text,
relevent_group,source
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="pubOrg != null" >
and pub_org ${pubOrgOperator} #{pubOrg}
</if>
<if test="pubUser != null" >
and pub_user ${pubUserOperator} #{pubUser}
</if>
<if test="pubTime != null" >
and pub_time ${pubTimeOperator} #{pubTime}
</if>
<if test="pubTime1 != null" >
and pub_time &gt;= #{pubTime1}
</if>
<if test="pubTime2 != null" >
and pub_time &lt;= #{pubTime2}
</if>
<if test="linkUri != null" >
and link_uri ${linkUriOperator} #{linkUri}
</if>
<if test="content != null" >
and content ${contentOperator} #{content}
</if>
<if test="title != null" >
and title ${titleOperator} concat(concat('%',#{title}),'%')
</if>
<if test="msgMode != null" >
and msg_mode ${msgModeOperator} #{msgMode}
</if>
<if test="msgType != null and msgType != 'DYNAMICS'" >
and msg_type ${msgTypeOperator} #{msgType}
</if>
<if test="msgType == 'DYNAMICS'" >
and (msg_type = 'INLAND' or msg_type = 'FOREIGN')
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="isPicMsg != null" >
and is_pic_msg ${isPicMsgOperator} #{isPicMsg}
</if>
<if test="saveLevel != null" >
and save_level ${isPicMsgOperator} #{saveLevel}
</if>
<if test="releventStand != null" >
and relevent_stand ${isPicMsgOperator} #{releventStand}
</if>
<if test="releventLaws != null" >
and relevent_laws ${isPicMsgOperator} #{releventLaws}
</if>
<if test="dataText != null" >
and data_text ${isPicMsgOperator} #{dataText}
</if>
<if test="source != null" >
and source = #{source}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_MSG_DYNAMIC_INFO.NEXTVAL FROM DUAL
</selectKey> -->
insert into MSG_DYNAMIC_INFO(<include refid="Base_Column_List" />)
values (#{isPicMsg},#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{pubOrg, jdbcType=VARCHAR}, #{pubUser, jdbcType=VARCHAR}, #{pubTime, jdbcType=TIMESTAMP}, #{linkUri, jdbcType=VARCHAR},#{title, jdbcType=VARCHAR}, #{msgMode, jdbcType=VARCHAR}, #{msgType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR},#{content, jdbcType=VARCHAR},#{contentText,jdbcType=CLOB}) </insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_MSG_DYNAMIC_INFO.NEXTVAL FROM DUAL
</selectKey> -->
insert into MSG_DYNAMIC_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="isPicMsg != null" >is_pic_msg,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="pubOrg != null" >pub_org,</if>
<if test="pubUser != null" >pub_user,</if>
<if test="pubTime != null" >pub_time,</if>
<if test="linkUri != null" >link_uri,</if>
<if test="content != null" >content,</if>
<if test="title != null" >title,</if>
<if test="msgMode != null" >msg_mode,</if>
<if test="msgType != null" >msg_type,</if>
<if test="id != null" >id,</if>
<if test="contentText != null">content_text,</if>
<if test="saveStatus != null">save_status,</if>
<if test="saveLevel != null">save_level,</if>
<if test="releventStand != null">relevent_stand</if>
<if test="releventLaws != null">relevent_laws,</if>
<if test="releventGroup != null">relevent_group,</if>
<if test="dataText != null">data_text,</if>
<if test="source != null">source,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="isPicMsg != null" >#{isPicMsg, jdbcType=INTEGER},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="pubOrg != null" >#{pubOrg, jdbcType=VARCHAR},</if>
<if test="pubUser != null" >#{pubUser, jdbcType=VARCHAR},</if>
<if test="pubTime != null" >#{pubTime, jdbcType=TIMESTAMP},</if>
<if test="linkUri != null" >#{linkUri, jdbcType=VARCHAR},</if>
<if test="content != null" >#{content, jdbcType=VARCHAR},</if>
<if test="title != null" >#{title, jdbcType=VARCHAR},</if>
<if test="msgMode != null" >#{msgMode, jdbcType=VARCHAR},</if>
<if test="msgType != null" >#{msgType, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="contentText !=null">#{contentText,jdbcType=CLOB},</if>
<if test="saveStatus !=null">#{saveStatus,jdbcType=VARCHAR},</if>
<if test="saveLevel !=null">#{saveLevel,jdbcType=VARCHAR},</if>
<if test="releventStand !=null">#{releventStand,jdbcType=VARCHAR},</if>
<if test="releventLaws !=null">#{releventLaws,jdbcType=VARCHAR},</if>
<if test="releventGroup !=null">#{releventGroup,jdbcType=VARCHAR},</if>
<if test="dataText !=null">#{dataText,jdbcType=VARCHAR},</if>
<if test="source !=null">#{source,jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO" >
update MSG_DYNAMIC_INFO
set modify_time = #{modifyTime},
is_pic_msg = #{isPicMsg},
creation_time = #{creationTime},
valid_flag = #{validFlag},
pub_org = #{pubOrg},
pub_user = #{pubUser},
pub_time = #{pubTime},
link_uri = #{linkUri},
content = #{content},
content_text = #{contentText,jdbcType=CLOB},
title = #{title},
msg_mode = #{msgMode},
msg_type = #{msgType}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO" >
update MSG_DYNAMIC_INFO
<set >
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="pubOrg != null" >
pub_org = #{pubOrg},
</if>
<if test="pubUser != null" >
pub_user = #{pubUser},
</if>
<if test="pubTime != null" >
pub_time = #{pubTime},
</if>
<if test="linkUri != null" >
link_uri = #{linkUri},
</if>
<if test="content != null" >
content = #{content},
</if>
<if test="title != null" >
title = #{title},
</if>
<if test="msgMode != null" >
msg_mode = #{msgMode},
</if>
<if test="msgType != null" >
msg_type = #{msgType},
</if>
<if test="isPicMsg != null" >
is_pic_msg = #{isPicMsg},
</if>
<if test="contentText != null">
content_text = #{contentText,jdbcType=CLOB},
</if>
<if test="saveStatus != null">
save_status = #{saveStatus},
</if>
<if test="saveLevel != null">
save_level = #{saveLevel},
</if>
<if test="releventStand != null">
relevent_stand = #{releventStand},
</if>
<if test="releventLaws != null">
relevent_laws = #{releventLaws},
</if>
<if test="releventGroup != null">
relevent_group = #{releventGroup},
</if>
<if test="dataText != null">
data_text = #{dataText},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 MSG_DYNAMIC_INFO -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from MSG_DYNAMIC_INFO
where id = #{value}
</select>
<!-- 删除记录 -->
<!--
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from MSG_DYNAMIC_INFO
where id = #{value}
</delete>
-->
<!--李文轩:删除记录-->
<update id="deleteByPrimaryKey" parameterType="java.lang.String">
UPDATE MSG_DYNAMIC_INFO
set valid_Flag = 1
WHERE id = #{id}
</update>
<!--李文轩:删除记录-->
<update id="deleteLogicInBatch" parameterType="java.util.List">
update MSG_DYNAMIC_INFO
set valid_flag = 1,save_status='delete'
where id in
<foreach item="msgId" collection="list" open="(" separator="," close=")" index="index">
#{msgId}
</foreach>
</update>
<!-- MSG_DYNAMIC_INFO 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from
(
select MSG_DYNAMIC_INFO.*,TS_USER.UNAME as pubUserName,
TS_ORG.ORG_NAME as pubOrgName,MSG_MODULE.MODULE_NAME as moduleName,
(
SELECT
listagg ( MSG_FILE.ATT_ID, ',' ) within GROUP ( ORDER BY MSG_FILE.ATT_ID )
FROM
MSG_FILE
WHERE
MSG_FILE.VALID_FLAG=0 and MSG_FILE.FILE_TYPE='PIC'
and MSG_FILE.MSG_ID = MSG_DYNAMIC_INFO.ID
) attPicIds
from MSG_DYNAMIC_INFO
left join TS_USER on MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG on MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
left join MSG_MODULE on MSG_DYNAMIC_INFO.MSG_MODE = MSG_MODULE.ID
<include refid="Base_Where_Clause"/>
and MSG_DYNAMIC_INFO.valid_flag = 0
<if test="moduleName != null and moduleName != ''">
and MSG_MODULE.ID=#{moduleName}
</if>
)
</select>
<!-- 查询MSG_DYNAMIC_INFO列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select pubUserName,pubOrgName,moduleName,attPicIds,<include refid="Base_Column_List" /> from
(select tmp_tb.* , rownum rn from
(select MSG_DYNAMIC_INFO.*,TS_USER.UNAME as pubUserName,
TS_ORG.ORG_NAME as pubOrgName,MSG_MODULE.MODULE_NAME as moduleName,
(
SELECT
listagg ( MSG_FILE.ATT_ID, ',' ) within GROUP ( ORDER BY MSG_FILE.ATT_ID )
FROM
MSG_FILE
WHERE
MSG_FILE.VALID_FLAG=0 and MSG_FILE.FILE_TYPE='PIC'
and MSG_FILE.MSG_ID = MSG_DYNAMIC_INFO.ID
) attPicIds
from MSG_DYNAMIC_INFO
left join TS_USER on MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG on MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
left join MSG_MODULE on MSG_DYNAMIC_INFO.MSG_MODE = MSG_MODULE.ID
<include refid="Base_Where_Clause"/>
and MSG_DYNAMIC_INFO.valid_flag = 0
<if test="moduleName != null and moduleName != ''">
and MSG_MODULE.ID=#{moduleName}
</if>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex}) a
where rn &gt;= ${pager.startIndex}
<if test="rowLimit != null and rowLimit != ''">
and rn &lt;= #{rowLimit}
</if>
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from MSG_DYNAMIC_INFO
<include refid="Base_Where_Clause"/>
and MSG_DYNAMIC_INFO.valid_flag=0
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<!-- 根据id查询 MSG_DYNAMIC_INFO -->
<select id="selectByMsgId" resultMap="BaseResultMap" parameterType="java.lang.String">
select pubUserName,pubOrgName,<include refid="Base_Column_List"/>
from (
select TS_USER.UNAME as pubUserName,TS_ORG.ORG_NAME as pubOrgName,MSG_DYNAMIC_INFO.*
from MSG_DYNAMIC_INFO
left join TS_USER on MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG on MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
where MSG_DYNAMIC_INFO.id = #{value} and
(MSG_DYNAMIC_INFO.valid_flag = 0 or (MSG_DYNAMIC_INFO.valid_flag = 1 and save_status = 'save'))
)
</select>
<!--liwenxuan:动态信息更新数量:国内动态INLAND-->
<select id="selectDynamicInfoUpdateNumINLAND" parameterType="Date" resultType="java.lang.Integer">
SELECT
COUNT (1)
FROM MSG_DYNAMIC_INFO
WHERE
MODIFY_TIME > #{visitTime}
AND MSG_TYPE = 'INLAND' And valid_Flag=0
</select>
<!--liwenxuan:动态信息更新数量:国内动态INLANDAll-->
<select id="selectDynamicInfoUpdateNumINLANDAll" resultType="java.lang.Integer">
SELECT
COUNT (1)
FROM MSG_DYNAMIC_INFO
WHERE
MSG_TYPE = 'INLAND' And valid_Flag=0
</select>
<!--liwenxuan:动态信息更新数量:国际动态FOREIGN-->
<select id="selectDynamicInfoUpdateNumFOREIGN" parameterType="Date" resultType="java.lang.Integer">
SELECT
COUNT (1)
FROM MSG_DYNAMIC_INFO
WHERE
MODIFY_TIME > #{visitTime}
AND MSG_TYPE = 'FOREIGN' And valid_Flag=0
</select>
<!--liwenxuan:动态信息更新数量:国际动态FOREIGNAll-->
<select id="selectDynamicInfoUpdateNumFOREIGNAll" resultType="java.lang.Integer">
SELECT
COUNT (1)
FROM MSG_DYNAMIC_INFO
WHERE
MSG_TYPE = 'FOREIGN' And valid_Flag=0
</select>
<!-- gaoyan 搜索中心页面查询为我推荐 -->
<select id="selectRecommendMsgDynamicInfo" resultType="com.adc.da.slrs.msgDynamicInfo.vo.RecommendVO" parameterType="com.adc.da.slrs.msgDynamicInfo.page.MsgDynamicInfoEOPage">
select tmp_tb.* , rownum rn from
(select
MSG_DYNAMIC_INFO.title as nameShow,
MSG_DYNAMIC_INFO.id,
MSG_DYNAMIC_INFO.MSG_TYPE as module,
'MSG_DYNAMIC' as typeShow
from MSG_DYNAMIC_INFO
where MSG_DYNAMIC_INFO.valid_flag = '0' and (
1!=1
<if test="msgType != null" >
or msg_type = #{msgType}
</if>
)
order by modify_time desc
) tmp_tb where rownum &lt; 6
</select>
<!-- 条件查询后,用于导出动态信息数据 搜索中心-->
<select id="getMsgDynamicInfoForExport" resultMap="BaseResultMapExcel" parameterType="com.adc.da.slrs.msgDynamicInfo.page.MsgDynamicInfoEOPage">
SELECT
case
when MSG_DYNAMIC_INFO.MSG_TYPE = 'FOREIGN' then '国际动态'
when MSG_DYNAMIC_INFO.MSG_TYPE = 'INLAND' then '国内动态'
when MSG_DYNAMIC_INFO.MSG_TYPE = 'RESOURCE' then '资料中心'
else MSG_DYNAMIC_INFO.MSG_TYPE
end
as MSG_TYPE,
MSG_MODULE.MODULE_NAME as MSG_MODE,
MSG_DYNAMIC_INFO.TITLE,
MSG_DYNAMIC_INFO.link_uri,
MSG_DYNAMIC_INFO.pub_time,
TS_USER.UNAME as pub_user,
TS_ORG.ORG_NAME as pub_org,
MSG_DYNAMIC_INFO.content
FROM
MSG_DYNAMIC_INFO
left join TS_USER ON MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG ON MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
left join MSG_MODULE ON MSG_DYNAMIC_INFO.MSG_MODE = MSG_MODULE.ID
<!-- 导出数据过程中,选择的id -->
<if test="idList != null">
where MSG_DYNAMIC_INFO.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="showDetailsByRole" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO">
select MSG_DYNAMIC_INFO.id
from MSG_DYNAMIC_INFO left join TS_ROLE_MSG_MODULE on MSG_DYNAMIC_INFO.MSG_MODE = TS_ROLE_MSG_MODULE.MSG_MODULE_ID
left join TS_ROLE on TS_ROLE_MSG_MODULE.ROLE_ID = TS_ROLE.ID
where MSG_DYNAMIC_INFO.valid_flag=0
and TS_ROLE.valid_flag=0
<if test="id != null">
and MSG_DYNAMIC_INFO.id=#{id}
</if>
and TS_ROLE_MSG_MODULE.ROLE_ID in
<foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="queryAllByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from
(
select MSG_DYNAMIC_INFO.*,TS_USER.UNAME as pubUserName,
TS_ORG.ORG_NAME as pubOrgName,MSG_MODULE.MODULE_NAME as moduleName,
(
SELECT
listagg ( MSG_FILE.ATT_ID, ',' ) within GROUP ( ORDER BY MSG_FILE.ATT_ID )
FROM
MSG_FILE
WHERE
MSG_FILE.VALID_FLAG=0 and MSG_FILE.FILE_TYPE='PIC'
and MSG_FILE.MSG_ID = MSG_DYNAMIC_INFO.ID
) attPicIds
from MSG_DYNAMIC_INFO
left join TS_USER on MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG on MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
left join MSG_MODULE on MSG_DYNAMIC_INFO.MSG_MODE = MSG_MODULE.ID
<include refid="Base_Where_Clause"/>
and MSG_DYNAMIC_INFO.save_status != 'delete'
<if test="moduleName != null and moduleName != ''">
and MSG_MODULE.ID=#{moduleName}
</if>
)
</select>
<!-- 查询MSG_DYNAMIC_INFO列表 -->
<select id="queryAllByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select pubUserName,pubOrgName,moduleName,attPicIds,<include refid="Base_Column_List" /> from
(select tmp_tb.* , rownum rn from
(select MSG_DYNAMIC_INFO.*,TS_USER.UNAME as pubUserName,
TS_ORG.ORG_NAME as pubOrgName,MSG_MODULE.MODULE_NAME as moduleName,
(
SELECT
listagg ( MSG_FILE.ATT_ID, ',' ) within GROUP ( ORDER BY MSG_FILE.ATT_ID )
FROM
MSG_FILE
WHERE
MSG_FILE.VALID_FLAG=0 and MSG_FILE.FILE_TYPE='PIC'
and MSG_FILE.MSG_ID = MSG_DYNAMIC_INFO.ID
) attPicIds
from MSG_DYNAMIC_INFO
left join TS_USER on MSG_DYNAMIC_INFO.PUB_USER = TS_USER.USID
left join TS_ORG on MSG_DYNAMIC_INFO.PUB_ORG = TS_ORG.ID
left join MSG_MODULE on MSG_DYNAMIC_INFO.MSG_MODE = MSG_MODULE.ID
<include refid="Base_Where_Clause"/>
and MSG_DYNAMIC_INFO.save_status != 'delete'
<if test="moduleName != null and moduleName != ''">
and MSG_MODULE.ID=#{moduleName}
</if>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex}) a
where rn &gt;= ${pager.startIndex}
<if test="rowLimit != null and rowLimit != ''">
and rn &lt;= #{rowLimit}
</if>
</select>
</mapper>