Merge branch 'develop_1' into 'develop_master'
Develop 1 See merge request LiuChao/foton-slrs-system-rest!314
This commit is contained in:
+564
@@ -0,0 +1,564 @@
|
||||
<?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 >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null" >
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
and creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null" >
|
||||
and creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null" >
|
||||
and creation_time <= #{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 >= #{pubTime1}
|
||||
</if>
|
||||
<if test="pubTime2 != null" >
|
||||
and pub_time <= #{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 <= ${pager.endIndex}) a
|
||||
where rn >= ${pager.startIndex}
|
||||
<if test="rowLimit != null and rowLimit != ''">
|
||||
and rn <= #{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 < 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 <= ${pager.endIndex}) a
|
||||
where rn >= ${pager.startIndex}
|
||||
<if test="rowLimit != null and rowLimit != ''">
|
||||
and rn <= #{rowLimit}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,211 @@
|
||||
<?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.MsgFileEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.msgDynamicInfo.entity.MsgFileEO" >
|
||||
<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="att_id" property="attId" />
|
||||
<result column="file_suffix" property="fileSuffix" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="msg_id" property="msgId" />
|
||||
<result column="file_type" property="fileType" />
|
||||
</resultMap>
|
||||
|
||||
<!-- MSG_FILE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, att_id, file_suffix, file_name, msg_id, id,file_type
|
||||
</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 >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null" >
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
and creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null" >
|
||||
and creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null" >
|
||||
and creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="attId != null" >
|
||||
and att_id ${attIdOperator} #{attId}
|
||||
</if>
|
||||
<if test="fileSuffix != null" >
|
||||
and file_suffix ${fileSuffixOperator} #{fileSuffix}
|
||||
</if>
|
||||
<if test="fileName != null" >
|
||||
and file_name ${fileNameOperator} #{fileName}
|
||||
</if>
|
||||
<if test="msgId != null" >
|
||||
and msg_id ${msgIdOperator} #{msgId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="fileType != null" >
|
||||
and file_type ${fileTypeOperator} #{fileType}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgFileEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_MSG_FILE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into MSG_FILE(<include refid="Base_Column_List" />)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{attId, jdbcType=VARCHAR}, #{fileSuffix, jdbcType=VARCHAR}, #{fileName, jdbcType=VARCHAR}, #{msgId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR},#{fileType, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgFileEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_MSG_FILE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into MSG_FILE
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="modifyTime != null" >modify_time,</if>
|
||||
<if test="creationTime != null" >creation_time,</if>
|
||||
<if test="validFlag != null" >valid_flag,</if>
|
||||
<if test="attId != null" >att_id,</if>
|
||||
<if test="fileSuffix != null" >file_suffix,</if>
|
||||
<if test="fileName != null" >file_name,</if>
|
||||
<if test="msgId != null" >msg_id,</if>
|
||||
<if test="id != null" >id,</if>
|
||||
<if test="fileType != null" >file_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<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="attId != null" >#{attId, jdbcType=VARCHAR},</if>
|
||||
<if test="fileSuffix != null" >#{fileSuffix, jdbcType=VARCHAR},</if>
|
||||
<if test="fileName != null" >#{fileName, jdbcType=VARCHAR},</if>
|
||||
<if test="msgId != null" >#{msgId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
<if test="fileType != null" >#{fileType, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgFileEO" >
|
||||
update MSG_FILE
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
att_id = #{attId},
|
||||
file_suffix = #{fileSuffix},
|
||||
file_name = #{fileName},
|
||||
msg_id = #{msgId},
|
||||
file_type = #{fileType}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.msgDynamicInfo.entity.MsgFileEO" >
|
||||
update MSG_FILE
|
||||
<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="attId != null" >
|
||||
att_id = #{attId},
|
||||
</if>
|
||||
<if test="fileSuffix != null" >
|
||||
file_suffix = #{fileSuffix},
|
||||
</if>
|
||||
<if test="fileName != null" >
|
||||
file_name = #{fileName},
|
||||
</if>
|
||||
<if test="msgId != null" >
|
||||
msg_id = #{msgId},
|
||||
</if>
|
||||
<if test="fileType != null" >
|
||||
file_type = #{fileType},
|
||||
</if>
|
||||
</set>
|
||||
<!-- where id = #{id}-->
|
||||
where msg_file.id in
|
||||
<foreach item="id" collection="msglist" open="(" separator=","
|
||||
close=")" index="index">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteLogicInBatch" parameterType="java.util.List">
|
||||
update MSG_FILE
|
||||
set valid_flag = 1
|
||||
where msg_id in
|
||||
<foreach item="msgId" collection="list" open="(" separator=","
|
||||
close=")" index="index">
|
||||
#{msgId}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 根据id查询 MSG_FILE -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from MSG_FILE
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from MSG_FILE
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- MSG_FILE 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from MSG_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询MSG_FILE列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List" /> from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select <include refid="Base_Column_List" /> from MSG_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from MSG_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
|
||||
<!-- <if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if> -->
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
+532
@@ -0,0 +1,532 @@
|
||||
<?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.SarStandAndLawsEODao">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,showNumber,country,showName,typeShow,standYear,issueTime,putTime,productPutTime,newproductPutTime,standStateShow,responsibleUnitId
|
||||
,responsibleUnitName,categoryShow,applyArcticShow,natureShow
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="typeShow != null">
|
||||
and typeShow like concat(concat('%',#{typeShow}),'%')
|
||||
</if>
|
||||
<if test="showNumber != null">
|
||||
and showNumber like concat(concat('%',#{showNumber}),'%')
|
||||
</if>
|
||||
<if test="showName != null">
|
||||
and showName like concat(concat('%',#{showName}),'%')
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<!-- 查询所有的国内标准,国内外法规,企业标准-->
|
||||
<select id="selectStandAndLawsInfo" resultType="com.adc.da.slrs.msgDynamicInfo.entity.SarStandAndLawsEO"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
(select tmp_tb.* , rownum rn from(SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS id,
|
||||
DECODE(SAR_STANDARDS_INFO.STAND_YEAR,null,SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year
|
||||
) AS showNumber,
|
||||
SAR_STANDARDS_INFO.country,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow,
|
||||
SAR_STANDARDS_INFO.stand_year as standYear ,
|
||||
SAR_STANDARDS_INFO.issue_time as issueTime,
|
||||
SAR_STANDARDS_INFO.put_time as putTime,
|
||||
SAR_STANDARDS_INFO.product_put_time as productPutTime,
|
||||
SAR_STANDARDS_INFO.newproduct_put_time as newproductPutTime,
|
||||
dicNature.DIC_TYPE_NAME as natureShow,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'CATEGORY'
|
||||
) AS categoryShow,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicNature ON ( dicNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature AND
|
||||
dicNature.dic_id IS NOT NULL AND dicNature.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_STANDARDS_INFO.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.valid_flag = 0 UNION
|
||||
SELECT
|
||||
sar_laws_info.id AS id,
|
||||
sar_laws_info.laws_NUMBER AS shownumber,
|
||||
sar_laws_info.country,
|
||||
sar_laws_info.laws_NAME AS showname,
|
||||
sar_laws_info.laws_type || '_LAWS' AS typeShow,
|
||||
NULL AS stand_year,
|
||||
sar_laws_info.issue_time,
|
||||
sar_laws_info.put_time,
|
||||
NULL AS product_put_time,
|
||||
NULL AS newproduct_put_time,
|
||||
dicproperty.DIC_TYPE_NAME as natureShow,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as category,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_LAWS_VAL.property_type )
|
||||
FROM
|
||||
SAR_LAWS_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_LAWS_VAL.property_val and TS_DICTYPE.dic_id
|
||||
is not null)
|
||||
WHERE
|
||||
SAR_LAWS_VAL.LAWS_id = SAR_LAWS_INFO.id
|
||||
AND SAR_LAWS_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
sar_laws_info LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_LAWS_INFO.laws_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
LEFT JOIN TS_DICTYPE dicproperty ON ( dicproperty.dic_type_code = SAR_LAWS_INFO.laws_property AND
|
||||
dicproperty.dic_id IS NOT NULL AND dicproperty.valid_flag = 0 )
|
||||
left join TS_ORG on sar_laws_info.responsible_unit = TS_ORG.id
|
||||
where SAR_LAWS_INFO.valid_flag = 0 UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS id,
|
||||
DECODE(SAR_BUSSIONESS_STAND.STAND_YEAR,null,dicstandsort.dic_type_name || ' ' || SAR_BUSSIONESS_STAND.stand_code,
|
||||
dicstandsort.dic_type_name || ' ' || SAR_BUSSIONESS_STAND.stand_code || '-' || SAR_BUSSIONESS_STAND.stand_year
|
||||
) AS shownumber,
|
||||
'中国' AS country,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS showname,
|
||||
'BUSINESS_STAND' AS typeShow,
|
||||
NULL AS stand_year,
|
||||
SAR_BUSSIONESS_STAND.issue_time,
|
||||
SAR_BUSSIONESS_STAND.put_time,
|
||||
NULL AS product_put_time,
|
||||
NULL AS newproduct_put_time,
|
||||
null as natureShow,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as category,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_BUSS_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_BUSS_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_BUSS_STAND_VAL.property_value and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_BUSS_STAND_VAL.stand_id = SAR_BUSSIONESS_STAND.id
|
||||
AND SAR_BUSS_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND LEFT JOIN SAR_BUSS_STAND_VAL ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_VAL.stand_id
|
||||
LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_BUSSIONESS_STAND.STAND_STATUS AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicstandsort on (dicstandsort.dic_type_code= SAR_BUSSIONESS_STAND.STAND_SORT and dicstandsort.valid_flag=0 and dicstandsort.dic_id is not null) left join TS_ORG on SAR_BUSSIONESS_STAND.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.valid_flag = 0
|
||||
)
|
||||
<include refid="Base_Where_Clause"></include>
|
||||
|
||||
) tmp_tb where rownum<= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
|
||||
</select>
|
||||
<select id="selectStandAndLawsInfoCount" resultType="int"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS id,
|
||||
SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' || SAR_STANDARDS_INFO.STAND_YEAR
|
||||
AS shownumber,
|
||||
SAR_STANDARDS_INFO.country,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showname,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow,
|
||||
SAR_STANDARDS_INFO.stand_year,
|
||||
SAR_STANDARDS_INFO.issue_time,
|
||||
SAR_STANDARDS_INFO.product_put_time,
|
||||
SAR_STANDARDS_INFO.newproduct_put_time,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'CATEGORY'
|
||||
) AS categoryShow,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_STANDARDS_INFO.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.valid_flag = 0 UNION
|
||||
SELECT
|
||||
sar_laws_info.id AS id,
|
||||
sar_laws_info.laws_NUMBER AS shownumber,
|
||||
sar_laws_info.country,
|
||||
sar_laws_info.laws_NAME AS showname,
|
||||
sar_laws_info.laws_type || '_LAWS' AS typeShow,
|
||||
NULL AS stand_year,
|
||||
sar_laws_info.issue_time,
|
||||
NULL AS product_put_time,
|
||||
NULL AS newproduct_put_time,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as category,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_LAWS_VAL.property_type )
|
||||
FROM
|
||||
SAR_LAWS_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_LAWS_VAL.property_val and TS_DICTYPE.dic_id
|
||||
is not null)
|
||||
WHERE
|
||||
SAR_LAWS_VAL.LAWS_id = SAR_LAWS_INFO.id
|
||||
AND SAR_LAWS_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
sar_laws_info LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_LAWS_INFO.laws_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on sar_laws_info.responsible_unit = TS_ORG.id
|
||||
where SAR_LAWS_INFO.valid_flag = 0 UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS id,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS shownumber,
|
||||
'中国' AS country,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS showname,
|
||||
'BUSINESS_STAND' AS typeShow,
|
||||
NULL AS stand_year,
|
||||
SAR_BUSSIONESS_STAND.issue_time,
|
||||
NULL AS product_put_time,
|
||||
NULL AS newproduct_put_time,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as category,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_BUSS_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_BUSS_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_BUSS_STAND_VAL.property_value and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_BUSS_STAND_VAL.stand_id = SAR_BUSSIONESS_STAND.id
|
||||
AND SAR_BUSS_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND LEFT JOIN SAR_BUSS_STAND_VAL ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_VAL.stand_id
|
||||
LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_BUSSIONESS_STAND.STAND_STATUS AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_BUSSIONESS_STAND.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.valid_flag = 0
|
||||
)
|
||||
<include refid="Base_Where_Clause"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询所有的国内标准和企业标准-->
|
||||
<select id="selectStand" resultType="com.adc.da.slrs.msgDynamicInfo.entity.SarStandAndLawsEO"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
select
|
||||
*
|
||||
from
|
||||
(select tmp_tb.* , rownum rn from(SELECT
|
||||
id,showNumber,country,showName,typeShow,standYear,issueTime,productPutTime,newproductPutTime,standStateShow,responsibleUnitId
|
||||
,responsibleUnitName,categoryShow,applyArcticShow
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS id,
|
||||
DECODE(SAR_STANDARDS_INFO.STAND_YEAR,null,SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year
|
||||
) AS showNumber,
|
||||
SAR_STANDARDS_INFO.country,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow,
|
||||
SAR_STANDARDS_INFO.stand_year as standYear ,
|
||||
SAR_STANDARDS_INFO.issue_time as issueTime,
|
||||
SAR_STANDARDS_INFO.product_put_time as productPutTime,
|
||||
SAR_STANDARDS_INFO.newproduct_put_time as newproductPutTime,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'CATEGORY'
|
||||
) AS categoryShow,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_STANDARDS_INFO.responsible_unit = TS_ORG.id
|
||||
left join SAR_STAND_MENU on SAR_STANDARDS_INFO.id=SAR_STAND_MENU.stand_id
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.valid_flag = 0
|
||||
<if test="menuRoleList != null">
|
||||
and SAR_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS id,
|
||||
DECODE(SAR_BUSSIONESS_STAND.STAND_YEAR,null,dicstandsort.dic_type_name || ' ' || SAR_BUSSIONESS_STAND.stand_code,
|
||||
dicstandsort.dic_type_name || ' ' || SAR_BUSSIONESS_STAND.stand_code || '-' || SAR_BUSSIONESS_STAND.stand_year
|
||||
) AS shownumber,
|
||||
'中国' AS country,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS showname,
|
||||
'BUSINESS_STAND' AS typeShow,
|
||||
NULL AS stand_year,
|
||||
SAR_BUSSIONESS_STAND.issue_time,
|
||||
NULL AS product_put_time,
|
||||
NULL AS newproduct_put_time,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as category,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_BUSS_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_BUSS_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_BUSS_STAND_VAL.property_value and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_BUSS_STAND_VAL.stand_id = SAR_BUSSIONESS_STAND.id
|
||||
AND SAR_BUSS_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND LEFT JOIN SAR_BUSS_STAND_VAL ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_VAL.stand_id
|
||||
LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_BUSSIONESS_STAND.STAND_STATUS AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicstandsort on (dicstandsort.dic_type_code= SAR_BUSSIONESS_STAND.STAND_SORT and dicstandsort.valid_flag=0 and dicstandsort.dic_id is not null)
|
||||
left join TS_ORG on SAR_BUSSIONESS_STAND.responsible_unit = TS_ORG.id
|
||||
left join SAR_BUSS_STAND_MENU on SAR_BUSS_STAND_MENU.BUSS_STAND_ID = SAR_BUSSIONESS_STAND.id
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.valid_flag = 0
|
||||
<if test="menuRoleList != null">
|
||||
and SAR_BUSS_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
<include refid="Base_Where_Clause"></include>
|
||||
GROUP BY id,showNumber,country,showName,typeShow,standYear,issueTime,productPutTime,newproductPutTime,standStateShow,responsibleUnitId
|
||||
,responsibleUnitName,categoryShow,applyArcticShow
|
||||
) tmp_tb where rownum<= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
|
||||
</select>
|
||||
<select id="selectStandCount" resultType="int"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
(
|
||||
select
|
||||
id,showNumber,country,showName,typeShow,standYear,issueTime,productPutTime,newproductPutTime,standStateShow,responsibleUnitId
|
||||
,responsibleUnitName,categoryShow,applyArcticShow from (
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS id,
|
||||
SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' || SAR_STANDARDS_INFO.STAND_YEAR
|
||||
AS shownumber,
|
||||
SAR_STANDARDS_INFO.country,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showname,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow,
|
||||
SAR_STANDARDS_INFO.stand_year as standYear ,
|
||||
SAR_STANDARDS_INFO.issue_time as issueTime,
|
||||
SAR_STANDARDS_INFO.product_put_time as productPutTime,
|
||||
SAR_STANDARDS_INFO.newproduct_put_time as newproductPutTime,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'CATEGORY'
|
||||
) AS categoryShow,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_STAND_VAL.property_val and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_STAND_VAL.stand_id = SAR_STANDARDS_INFO.id
|
||||
AND SAR_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_STANDARDS_INFO.responsible_unit = TS_ORG.id
|
||||
left join SAR_STAND_MENU on SAR_STANDARDS_INFO.id=SAR_STAND_MENU.stand_id
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.valid_flag = 0
|
||||
<if test="menuRoleList != null">
|
||||
and SAR_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
UNION
|
||||
SELECT
|
||||
SAR_BUSSIONESS_STAND.id AS id,
|
||||
SAR_BUSSIONESS_STAND.stand_code AS shownumber,
|
||||
'中国' AS country,
|
||||
SAR_BUSSIONESS_STAND.stand_NAME AS showname,
|
||||
'BUSINESS_STAND' AS typeShow,
|
||||
NULL as standYear,
|
||||
SAR_BUSSIONESS_STAND.issue_time as issueTime,
|
||||
NULL as productPutTime,
|
||||
NULL as newproductPutTime,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,
|
||||
NULL as categoryShow,
|
||||
TS_ORG.id as responsibleUnitId,
|
||||
TS_ORG.org_name as responsibleUnitName,
|
||||
(
|
||||
SELECT
|
||||
listagg ( TS_DICTYPE.DIC_TYPE_NAME, ',' ) within GROUP ( ORDER BY SAR_BUSS_STAND_VAL.property_type )
|
||||
FROM
|
||||
SAR_BUSS_STAND_VAL left join TS_DICTYPE on (TS_DICTYPE.dic_type_code = SAR_BUSS_STAND_VAL.property_value and
|
||||
TS_DICTYPE.dic_id is not null)
|
||||
WHERE
|
||||
SAR_BUSS_STAND_VAL.stand_id = SAR_BUSSIONESS_STAND.id
|
||||
AND SAR_BUSS_STAND_VAL.property_type = 'APPLY_ARCTIC'
|
||||
) AS applyArcticShow
|
||||
FROM
|
||||
SAR_BUSSIONESS_STAND LEFT JOIN SAR_BUSS_STAND_VAL ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_VAL.stand_id
|
||||
LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_BUSSIONESS_STAND.STAND_STATUS AND
|
||||
dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 )
|
||||
left join TS_ORG on SAR_BUSSIONESS_STAND.responsible_unit = TS_ORG.id
|
||||
left join SAR_BUSS_STAND_MENU on SAR_BUSS_STAND_MENU.BUSS_STAND_ID = SAR_BUSSIONESS_STAND.id
|
||||
WHERE
|
||||
SAR_BUSSIONESS_STAND.valid_flag = 0
|
||||
<if test="menuRoleList != null">
|
||||
and SAR_BUSS_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
<include refid="Base_Where_Clause"></include>
|
||||
GROUP BY
|
||||
id,showNumber,country,showName,typeShow,standYear,issueTime,productPutTime,newproductPutTime,standStateShow,responsibleUnitId
|
||||
,responsibleUnitName,categoryShow,applyArcticShow
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectStandNameAndType" resultType="com.adc.da.slrs.msgDynamicInfo.entity.SarStandAndLawsEO"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
SELECT
|
||||
DECODE(SAR_STANDARDS_INFO.STAND_YEAR,null,SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year
|
||||
) AS showNumber,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showName,id,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow FROM
|
||||
SAR_STANDARDS_INFO where
|
||||
SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' || SAR_STANDARDS_INFO.STAND_YEAR =#{showNumber}
|
||||
or SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER = #{showNumber}
|
||||
</select>
|
||||
|
||||
<!-- 查询所有的国内标准,国内外法规,企业标准-->
|
||||
<select id="queryByNameNumber" resultType="com.adc.da.slrs.msgDynamicInfo.entity.SarStandAndLawsEO"
|
||||
parameterType="com.adc.da.slrs.msgDynamicInfo.page.SarStandAndLawsEOPage">
|
||||
SELECT
|
||||
SAR_STANDARDS_INFO.id AS id,
|
||||
DECODE(SAR_STANDARDS_INFO.STAND_YEAR,null,SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_sort || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year
|
||||
) AS showNumber,
|
||||
SAR_STANDARDS_INFO.STAND_NAME AS showName,
|
||||
SAR_STANDARDS_INFO.stand_type || '_STAND' AS typeShow,
|
||||
dicstandState.DIC_TYPE_NAME AS standStateShow
|
||||
FROM
|
||||
SAR_STANDARDS_INFO left join TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state AND dicstandState.dic_id IS NOT NULL AND dicstandState.valid_flag = 0 ) left join TS_ORG ON SAR_STANDARDS_INFO.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_STANDARDS_INFO.valid_flag = 0
|
||||
<if test="showNumber != null">
|
||||
and (SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER || '-' || SAR_STANDARDS_INFO.STAND_YEAR =#{showNumber}
|
||||
or SAR_STANDARDS_INFO.STAND_SORT || ' ' || SAR_STANDARDS_INFO.STAND_NUMBER =#{showNumber}
|
||||
or SAR_STANDARDS_INFO.STAND_NAME =#{showNumber}
|
||||
)
|
||||
</if>
|
||||
UNION
|
||||
SELECT
|
||||
sar_laws_info.id AS id,
|
||||
sar_laws_info.laws_NUMBER AS shownumber,
|
||||
sar_laws_info.laws_NAME AS showname,
|
||||
sar_laws_info.laws_type || '_LAWS' AS typeShow,
|
||||
dicstandState.DIC_TYPE_NAME AS standStateShow
|
||||
FROM
|
||||
sar_laws_info LEFT JOIN TS_DICTYPE dicstandState ON ( dicstandState.dic_type_code = SAR_LAWS_INFO.laws_state AND dicstandState.dic_id IS NOT NULL AND dicstandState. valid_flag = 0 ) left join TS_ORG ON sar_laws_info.responsible_unit = TS_ORG.id
|
||||
WHERE
|
||||
SAR_LAWS_INFO.valid_flag = 0
|
||||
<if test="showNumber != null">
|
||||
and (sar_laws_info.laws_NUMBER = #{showNumber}
|
||||
or sar_laws_info.laws_NAME = #{showNumber}
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user