Files
foton-slrs-system-rest/adc-da-slrs/src/main/resources/mybatis/mapper/sarStandardsInfo/SarStandardsInfoMapper.xml
T

1865 lines
90 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.sarStandardsInfo.dao.SarStandardsInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
<id column="id" property="id" />
<result column="stand_type" property="standType" />
<result column="country" property="country" />
<result column="stand_sort" property="standSort" />
<result column="stand_number" property="standNumber" />
<result column="stand_year" property="standYear" />
<result column="stand_name" property="standName" />
<result column="stand_en_name" property="standEnName" />
<result column="stand_state" property="standState" />
<result column="stand_nature" property="standNature" />
<result column="issue_time" property="issueTime" />
<result column="put_time" property="putTime" />
<result column="synopsis" property="synopsis" />
<result column="replace_stand_num" property="replaceStandNum" />
<result column="replaced_stand_num" property="replacedStandNum" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
<result column="newCarPutTime" property="newCarPutTime" />
<result column="is_relate_access" property="isRelateAccess" />
<result column="cite_stand" property="citeStand" />
<result column="cited_stand" property="citedStand" />
<result column="allPutTime" property="allPutTime" />
<result column="text_status" property="textStatus" />
<result column="stand_system" property="standSystem" />
<result column="DTBZH" property="dtbzh" />
</resultMap>
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
<result column="is_relate_access" property="isRelateAccess" />
<result column="synopsis" property="synopsis"/>
<result column="put_time" property="putTime"/>
<result column="issue_time" property="issueTime"/>
<result column="replaced_stand_num" property="replacedStandNum"/>
<result column="replace_stand_num" property="replaceStandNum"/>
<result column="stand_en_name" property="standEnName"/>
<result column="stand_name" property="standName"/>
<result column="stand_year" property="standYear"/>
<result column="stand_number" property="standNumber"/>
<result column="id" property="id"/>
</resultMap>
<!-- SAR_STANDARDS_INFO table all fields -->
<sql id="Base_Column_List" >
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
SAR_STANDARDS_INFO.synopsis, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,SAR_STANDARDS_INFO.is_relate_access,SAR_STANDARDS_INFO.cite_stand,SAR_STANDARDS_INFO.cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Base_Column_List_DIS" >
DISTINCT SAR_STANDARDS_INFO.id,
SAR_STANDARDS_INFO.stand_type,
SAR_STANDARDS_INFO.country,
SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number,
SAR_STANDARDS_INFO.stand_year,
SAR_STANDARDS_INFO.stand_name,
SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state,
SAR_STANDARDS_INFO.stand_nature,
SAR_STANDARDS_INFO.issue_time,
SAR_STANDARDS_INFO.put_time,
SAR_STANDARDS_INFO.text_status,
SAR_STANDARDS_INFO.creation_user,
SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time,
SAR_STANDARDS_INFO.modify_time,
SAR_STANDARDS_INFO.STAND_SYSTEM,
SAR_STANDARDS_INFO.IS_RELATE_ACCESS,
SAR_STAND_ATTR_INFO.CHJL AS CHJL,
SAR_STAND_ATTR_INFO.DTBJH AS DTBZH,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow,
(
CASE
WHEN SAR_STAND_ATTR_INFO.SSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.SSRQ
END
) AS SSRQ,
(
CASE
WHEN SAR_STAND_ATTR_INFO.ZCCSSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.ZCCSSRQ
END
) AS ZCCSSRQ,
(
CASE
WHEN SAR_STAND_ATTR_INFO.XCXSSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.XCXSSRQ
END
) AS XCXSSRQ
</sql>
<sql id="Base_Column_List_Show" >
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis, concat(replace_stand_num, '') as replace_stand_num, replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME as standSortShow,
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Base_Column_List_Export_Show" >
SAR_STANDARDS_INFO.id,
SAR_STANDARDS_INFO.stand_type,
SAR_STANDARDS_INFO.country,
SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number,
SAR_STANDARDS_INFO.stand_year,
SAR_STANDARDS_INFO.stand_name,
SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state,
SAR_STANDARDS_INFO.stand_nature,
SAR_STANDARDS_INFO.issue_time,
SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis,
concat(replace_stand_num, '') as replace_stand_num,
replaced_stand_num,
SAR_STANDARDS_INFO.creation_user,
SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time,
SAR_STANDARDS_INFO.modify_time,
dicstandSort.DIC_TYPE_NAME as standSortShow,
dicstandNature.DIC_TYPE_NAME as standNatureShow,
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,
is_relate_access,
cite_stand,
cited_stand,
SAR_STANDARDS_INFO.text_status,
SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Group_Column_List_Export_Show">
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME,
dicstandNature.DIC_TYPE_NAME,
dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<sql id="Group_Column_List_Show">
SAR_STANDARDS_INFO.id, SAR_STANDARDS_INFO.stand_type, SAR_STANDARDS_INFO.country, SAR_STANDARDS_INFO.stand_sort,
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME,
dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="standType != null" >
and stand_type ${standTypeOperator} #{standType}
</if>
<if test="country != null" >
and country ${countryOperator} #{country}
</if>
<if test="standSort != null" >
and stand_sort ${standSortOperator} #{standSort}
</if>
<if test="standNumber != null" >
and stand_number ${standNumberOperator} #{standNumber}
</if>
<if test="standYear != null" >
and stand_year ${standYearOperator} #{standYear}
</if>
<if test="standName != null" >
and stand_name ${standNameOperator} #{standName}
</if>
<if test="standEnName != null" >
and stand_en_name ${standEnNameOperator} #{standEnName}
</if>
<if test="standState != null" >
and stand_state ${standStateOperator} #{standState}
</if>
<if test="standNature != null" >
and stand_nature ${standNatureOperator} #{standNature}
</if>
<if test="issueTime != null" >
and issue_time ${issueTimeOperator} #{issueTime}
</if>
<if test="issueTime1 != null" >
and issue_time &gt;= #{issueTime1}
</if>
<if test="issueTime2 != null" >
and issue_time &lt;= #{issueTime2}
</if>
<if test="putTime != null" >
and put_time ${putTimeOperator} #{putTime}
</if>
<if test="putTime1 != null" >
and put_time &gt;= #{putTime1}
</if>
<if test="putTime2 != null" >
and put_time &lt;= #{putTime2}
</if>
<if test="synopsis != null" >
and synopsis ${synopsisOperator} #{synopsis}
</if>
<if test="replaceStandNum != null" >
and replace_stand_num ${replaceStandNumOperator} #{replaceStandNum}
</if>
<if test="replacedStandNum != null" >
and replaced_stand_num ${replacedStandNumOperator} #{replacedStandNum}
</if>
<if test="creationUser != null" >
and creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</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="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="isRelateAccess != null" >
and is_relate_access = #{isRelateAccess}
</if>
<if test="textStatus != null" >
and text_status = #{textStatus}
</if>
<if test="standSystem != null" >
and stand_system = #{standSystem}
</if>
</trim>
</sql>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
insert into SAR_STANDARDS_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="standType != null" >stand_type,</if>
<if test="country != null" >country,</if>
<if test="standSort != null" >stand_sort,</if>
<if test="standNumber != null" >stand_number,</if>
<if test="standYear != null" >stand_year,</if>
<if test="standName != null" >stand_name,</if>
<if test="standEnName != null" >stand_en_name,</if>
<if test="standState != null" >stand_state,</if>
<if test="standNature != null" >stand_nature,</if>
<if test="issueTime != null" >issue_time,</if>
<if test="putTime != null" >put_time,</if>
<if test="synopsis != null" >synopsis,</if>
<if test="replaceStandNum != null" >replace_stand_num,</if>
<if test="replacedStandNum != null" >replaced_stand_num,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="isRelateAccess != null" >is_relate_access,</if>
<if test="citeStand != null" >cite_stand,</if>
<if test="citedStand != null" >cited_stand,</if>
<if test="textStatus != null" >text_status,</if>
<if test="standSystem != null" >stand_system,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="standType != null" >#{standType, jdbcType=VARCHAR},</if>
<if test="country != null" >#{country, jdbcType=VARCHAR},</if>
<if test="standSort != null" >#{standSort, jdbcType=VARCHAR},</if>
<if test="standNumber != null" >#{standNumber, jdbcType=VARCHAR},</if>
<if test="standYear != null" >#{standYear, jdbcType=VARCHAR},</if>
<if test="standName != null" >#{standName, jdbcType=VARCHAR},</if>
<if test="standEnName != null" >#{standEnName, jdbcType=VARCHAR},</if>
<if test="standState != null" >#{standState, jdbcType=VARCHAR},</if>
<if test="standNature != null" >#{standNature, jdbcType=VARCHAR},</if>
<if test="issueTime != null" >#{issueTime, jdbcType=VARCHAR},</if>
<if test="putTime != null" >#{putTime, jdbcType=TIMESTAMP},</if>
<if test="synopsis != null" >#{synopsis, jdbcType=CLOB},</if>
<if test="replaceStandNum != null" >#{replaceStandNum, jdbcType=CLOB},</if>
<if test="replacedStandNum != null" >#{replacedStandNum, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=VARCHAR},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="isRelateAccess != null" >#{isRelateAccess, jdbcType=VARCHAR},</if>
<if test="citeStand != null" >#{citeStand, jdbcType=VARCHAR},</if>
<if test="citedStand != null" >#{citedStand, jdbcType=VARCHAR},</if>
<if test="textStatus != null" >#{textStatus, jdbcType=VARCHAR},</if>
<if test="standSystem != null" >#{standSystem, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
update SAR_STANDARDS_INFO
set stand_type = #{standType},
country = #{country},
stand_sort = #{standSort},
stand_number = #{standNumber},
stand_year = #{standYear},
stand_name = #{standName},
stand_en_name = #{standEnName},
stand_state = #{standState},
stand_nature = #{standNature},
issue_time = #{issueTime},
put_time = #{putTime},
synopsis = #{synopsis},
replace_stand_num = #{replaceStandNum},
replaced_stand_num = #{replacedStandNum},
creation_user = #{creationUser},
valid_flag = #{validFlag},
creation_time = #{creationTime},
modify_time = #{modifyTime},
text_status = #{textStatus},
stand_system = #{standSystem}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo" >
update SAR_STANDARDS_INFO
<set >
<if test="standType != null" >
stand_type = #{standType},
</if>
<if test="country != null" >
country = #{country},
</if>
<if test="standSort != null" >
stand_sort = #{standSort},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standName != null" >
stand_name = #{standName},
</if>
<if test="standEnName != null" >
stand_en_name = #{standEnName},
</if>
<if test="standState != null" >
stand_state = #{standState},
</if>
<if test="standNature != null" >
stand_nature = #{standNature},
</if>
<if test="issueTime != null" >
issue_time = #{issueTime},
</if>
<if test="putTime != null" >
put_time = #{putTime},
</if>
<if test="synopsis != null" >
synopsis = #{synopsis},
</if>
<if test="replaceStandNum != null" >
replace_stand_num = #{replaceStandNum},
</if>
<if test="replacedStandNum != null" >
replaced_stand_num = #{replacedStandNum},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="isRelateAccess != null" >
is_relate_access = #{isRelateAccess},
</if>
<if test="citeStand != null" >
cite_stand = #{citeStand},
</if>
<if test="citedStand != null" >
cited_stand = #{citedStand},
</if>
<if test="textStatus != null" >
text_status = #{textStatus},
</if>
<if test="standSystem != null" >
stand_system = #{standSystem},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_STANDARDS_INFO -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_STANDARDS_INFO
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_STANDARDS_INFO
where id = #{value}
</delete>
<!-- SAR_STANDARDS_INFO 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_STANDARDS_INFO列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_STANDARDS_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<sql id="SarStandardsInfo_Where_Clause">
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id ='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
or (stand_name like concat(concat('%',#{standNumber}),'%'))
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
or STAND_YEAR like concat(concat('%',#{standName}),'%')
or STAND_SORT like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 游离态标准查询 -->
<!-- <if test="menuId != null and menuId =='nomenu' and standType =='INLAND'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='INLAND_STAND')
&lt;!&ndash;-查询游离态标准,编号和名称是分开的 &ndash;&gt;
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if>
<if test="menuId != null and menuId =='nomenu' and standType =='FOREIGN'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='FOREIGN_STAND')
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if> -->
<!-- 当第一次进入页面未选择记录时-->
<!-- <if test="(menuId == null or menuId =='') and standType =='INLAND'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='INLAND_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--标准年份-->
<if test="standYear != null and standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_Where_Export_Clause">
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
LEFT JOIN TS_DICTYPE dicstandNature ON (
dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature
AND dicstandNature.dic_id IS NOT NULL
AND dicstandNature.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
or (stand_name like concat(concat('%',#{standNumber}),'%'))
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
or STAND_YEAR like concat(concat('%',#{standName}),'%')
or STAND_SORT like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 游离态标准查询 -->
<!-- <if test="menuId != null and menuId =='nomenu' and standType =='INLAND'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='INLAND_STAND')
&lt;!&ndash;-查询游离态标准,编号和名称是分开的 &ndash;&gt;
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if>
<if test="menuId != null and menuId =='nomenu' and standType =='FOREIGN'">
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
='FOREIGN_STAND')
<if test="standNumber != null">
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR is null))
</if>
</if> -->
<!-- 当第一次进入页面未选择记录时-->
<!-- <if test="(menuId == null or menuId =='') and standType =='INLAND'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='INLAND_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--标准年份-->
<if test="standYear != null and standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="standSort_in">
ORDER BY
<if test='page.orderByA != null and page.orderByA != "" and page.order1 != null and page.order1 != ""'>
${page.orderByA} ${page.order1},
</if>
<if test='page.standType != null and page.standType == "INLAND"'>
CASE sar_standards_info.stand_sort
when 'GB' THEN 0
when 'GB/T' THEN 1
when 'QC/T' THEN 2
when 'JT' THEN 3
when 'JB' THEN 4
when 'GA' THEN 5
when 'GJB' THEN 6
when 'HJ' THEN 7
ELSE 8
END,
sar_standards_info.stand_sort ASC,CAST(sar_standards_info.STAND_NUMBER AS decimal(9,2)) ASC,sar_standards_info.STAND_YEAR DESC,sar_standards_info.id
</if>
<if test='page.standType != null and page.standType == "FOREIGN"'>
CASE sar_standards_info.stand_sort
when 'ECE' THEN 0
when 'EU' THEN 1
when 'EC' THEN 2
when 'EEC' THEN 3
when 'ISO' THEN 4
when 'IEC' THEN 5
when 'GTR' THEN 6
when 'CFR' THEN 7
when 'JASO' THEN 8
when 'JIS' THEN 9
when 'GSO' THEN 10
when 'GOST' THEN 11
when 'ΓOCT' THEN 12
when 'TP' THEN 13
when 'SASO' THEN 14
when 'UAE' THEN 15
when 'CONTRAN' THEN 16
when 'DENATRAN' THEN 17
when 'ABNT NBR' THEN 18
when 'NBR' THEN 19
when 'INMETRO' THEN 20
when 'CONAMA' THEN 21
when 'Normative Instruction' THEN 22
when 'ADR' THEN 23
ELSE 24
END,
sar_standards_info.stand_sort ASC,CAST(sar_standards_info.STAND_NUMBER AS decimal(9,2)) ASC,sar_standards_info.STAND_YEAR DESC,sar_standards_info.id
</if>
<if test='page.standType != null and page.standType == "ALL"'>
sar_standards_info.stand_sort ASC
</if>
</sql>
<sql id="standSort_out">
<if test='standType != null and standType == "INLAND"'>
CASE a.stand_sort
when 'GB' THEN 0
when 'GB/T' THEN 1
when 'QC/T' THEN 2
when 'JT' THEN 3
when 'JB' THEN 4
when 'GA' THEN 5
when 'GJB' THEN 6
when 'HJ' THEN 7
ELSE 8
END,
a.stand_sort ASC,
</if>
<if test='standType != null and standType == "FOREIGN"'>
CASE a.stand_sort
when 'ECE' THEN 0
when 'EU' THEN 1
when 'EC' THEN 2
when 'EEC' THEN 3
when 'ISO' THEN 4
when 'IEC' THEN 5
when 'GTR' THEN 6
when 'CFR' THEN 7
when 'JASO' THEN 8
when 'JIS' THEN 9
when 'GSO' THEN 10
when 'GOST' THEN 11
when 'ΓOCT' THEN 12
when 'TP' THEN 13
when 'SASO' THEN 14
when 'UAE' THEN 15
when 'CONTRAN' THEN 16
when 'DENATRAN' THEN 17
when 'ABNT NBR' THEN 18
when 'NBR' THEN 19
when 'INMETRO' THEN 20
when 'CONAMA' THEN 21
when 'Normative Instruction' THEN 22
when 'ADR' THEN 23
ELSE 24
END,
a.stand_sort ASC,
</if>
</sql>
<sql id="standSort_out_2">
<if test='page.standType != null and page.standType == "INLAND"'>
CASE a.stand_sort
when 'GB' THEN 0
when 'GB/T' THEN 1
when 'QC/T' THEN 2
when 'JT' THEN 3
when 'JB' THEN 4
when 'GA' THEN 5
when 'GJB' THEN 6
when 'HJ' THEN 7
ELSE 8
END,
a.stand_sort ASC,
</if>
<if test='page.standType != null and page.standType == "FOREIGN"'>
CASE a.stand_sort
when 'ECE' THEN 0
when 'EU' THEN 1
when 'EC' THEN 2
when 'EEC' THEN 3
when 'ISO' THEN 4
when 'IEC' THEN 5
when 'GTR' THEN 6
when 'CFR' THEN 7
when 'JASO' THEN 8
when 'JIS' THEN 9
when 'GSO' THEN 10
when 'GOST' THEN 11
when 'ΓOCT' THEN 12
when 'TP' THEN 13
when 'SASO' THEN 14
when 'UAE' THEN 15
when 'CONTRAN' THEN 16
when 'DENATRAN' THEN 17
when 'ABNT NBR' THEN 18
when 'NBR' THEN 19
when 'INMETRO' THEN 20
when 'CONAMA' THEN 21
when 'Normative Instruction' THEN 22
when 'ADR' THEN 23
ELSE 24
END,
a.stand_sort ASC,
</if>
</sql>
<sql id="SarStandardsInfo_in_left_2">
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
<!-- 标准类别DIC_ID 固定ID 区分 国家地区 -->
AND dicstandTextStatus.dic_id = 'JKSADFH564S'
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='page.standType != null and page.standType != "ALL"'>
and stand_type = #{page.standType}
</if>
<if test='page.syncParam != null and page.syncParam != ""'>
and SAR_STANDARDS_INFO.MODIFY_TIME between DATE_SUB(NOW(),INTERVAL 7 day) and DATE_SUB(NOW(),INTERVAL -1 day)
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="page.country != null and page.country != ''">
and country = #{page.country}
</if>
<!-- 标准编号111 -->
<if test="page.standNumber != null and page.standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ',''))
<if test="mark == 996">
or (trim(replace(stand_name,' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) )
</if>
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = ''-->
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
)
</if>
<!-- 标准名称 -->
<if test="page.standName != null and page.standName != ''">
and stand_name like concat(concat('%',#{page.standName}),'%')
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
</if>
<if test="page.standEnName != null and page.standEnName != ''">
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="page.standState != null and page.standState != ''">
and stand_state = #{page.standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="page.standNature != null and page.standNature != ''">
and stand_nature = #{page.standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="page.replaceStandNum != null and page.replaceStandNum != ''">
and SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{page.replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="page.replacedStandNum != null and page.replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{page.replacedStandNum}),'%')
</if>
<if test="page.isRelateAccess != null and page.isRelateAccess != ''" >
and is_relate_access = #{page.isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="page.menuId != null and page.menuId !='nomenu' and page.menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="page.menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="page.menuId != null and page.menuId =='nomenu' and page.sarMsType != null and page.sarMsType == 'filterSarMsMenu' and page.menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID not in
<foreach collection="page.menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="page.menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="page.menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="page.idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="page.idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="page.standSort != null and page.standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{page.standSort}
</if>
<!--标准年份-->
<if test="page.standYear != null and page.standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{page.standYear}
</if>
<!-- 发布日期日期-->
<if test="page.issueTime != null and page.issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{page.issueTime}
</if>
<!-- 范围查询 发布日期日期-->
<if test="page.startIssueTime != null and page.startIssueTime != '' and page.endIssueTime != null and page.endIssueTime != ''">
and
DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d')
between
DATE_FORMAT(#{page.startIssueTime} ,'%Y-%m-%d')
and
DATE_FORMAT(#{page.endIssueTime} ,'%Y-%m-%d')
</if>
<!--内容摘要-->
<if test="page.synopsis != null and page.synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{page.synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="page.textStatus != null and page.textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{page.textStatus}
</if>
<!--是否纳入法规清单-->
<if test="page.isRelateAccess != null and page.isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{page.isRelateAccess}
</if>
<if test="page.collectMenuId != null and page.collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{page.userId}
)
</if>
<!-- out -->
<if test='page.labelMenuId != null and page.labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='page.labelMenuId != null and page.labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{page.labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="page.applyArctic != null and page.applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{page.applyArctic}
</if>
<if test="null != page.advanceSearchStr and page.advanceSearchStr != ''">
and (${page.advanceSearchStr})
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left_3">
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
<!-- 标准类别DIC_ID 固定ID 区分 国家地区 -->
AND dicstandTextStatus.dic_id = 'JKSADFH564S'
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='page.standType != null and page.standType != "ALL"'>
and stand_type = #{page.standType}
</if>
<!-- 标准编号111 -->
<if test="page.standNumber != null and page.standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) = trim(replace(#{page.standNumber},' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) = trim(replace(#{page.standNumber},' ',''))
)
)
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left">
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='page.standType != null and page.standType != "ALL"'>
and stand_type = #{page.standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="page.country != null and page.country != ''">
and country = #{page.country}
</if>
<!-- 标准编号111 -->
<if test="page.standNumber != null and page.standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ',''))
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = ''-->
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
)
</if>
<!-- 标准名称 -->
<if test="page.standName != null and page.standName != ''">
and stand_name like concat(concat('%',#{page.standName}),'%')
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
</if>
<if test="page.standEnName != null and page.standEnName != ''">
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="page.standState != null and page.standState != ''">
and stand_state = #{page.standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="page.standNature != null and page.standNature != ''">
and stand_nature = #{page.standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="page.replaceStandNum != null and page.replaceStandNum != ''">
and SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{page.replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="page.replacedStandNum != null and page.replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{page.replacedStandNum}),'%')
</if>
<if test="page.isRelateAccess != null and page.isRelateAccess != ''" >
and is_relate_access = #{page.isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="page.menuId != null and page.menuId !='nomenu' and page.menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="page.menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="page.menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="page.menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="page.idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="page.idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="page.standSort != null and page.standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{page.standSort}
</if>
<!--标准年份-->
<if test="page.standYear != null and page.standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{page.standYear}
</if>
<!-- 发布日期日期-->
<if test="page.issueTime != null and page.issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{page.issueTime}
</if>
<!-- 范围查询 发布日期日期-->
<if test="page.startIssueTime != null and page.startIssueTime != '' and page.endIssueTime != null and page.endIssueTime != ''">
and
DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d')
between
DATE_FORMAT(#{page.startIssueTime} ,'%Y-%m-%d')
and
DATE_FORMAT(#{page.endIssueTime} ,'%Y-%m-%d')
</if>
<!--内容摘要-->
<if test="page.synopsis != null and page.synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{page.synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="page.textStatus != null and page.textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{page.textStatus}
</if>
<!--是否纳入法规清单-->
<if test="page.isRelateAccess != null and page.isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{page.isRelateAccess}
</if>
<if test="page.collectMenuId != null and page.collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{page.userId}
)
</if>
<!-- out -->
<if test='page.labelMenuId != null and page.labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='page.labelMenuId != null and page.labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{page.labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="page.applyArctic != null and page.applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{page.applyArctic}
</if>
<if test="page.advanceSearchStr != null and page.advanceSearchStr != ''">
and (${page.advanceSearchStr})
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left_wk">
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),
' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like
trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
or (trim(replace(stand_name,' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) )
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--标准年份-->
<if test="standYear != null and standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
</sql>
<!--&lt;!&ndash;直接在这区分了 1是国内地区 2是车型类别 3是重点跟踪清单 4是其他清单 5是项目清单&ndash;&gt;-->
<!-- 分页查询-->
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
SELECT
<include refid="Base_Column_List_DIS"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_in_left_2"/>
<if test="mark == 999 ">
and sar_standards_info.ID in (select distinct stand_id from sar_stand_items)
</if>
<if test='(page.orderByA != null and page.orderByA != "" and page.order1 != null and page.order1 != "")
or (page.standType != null and page.standType != "") '>
<include refid="standSort_in"/>
</if>
limit ${page.pager.startIndex-1},${page.pageSize}
</select>
<select id="getSarStandardsInfoByNum" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
SELECT
<include refid="Base_Column_List_DIS"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_in_left_3"/>
<if test='(page.orderByA != null and page.orderByA != "" and page.order1 != null and page.order1 != "")
or (page.standType != null and page.standType != "") '>
<include refid="standSort_in"/>
</if>
limit ${page.pager.startIndex-1},${page.pageSize}
</select>
<select id="selectHighLawsPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
SELECT
<include refid="Base_Column_List_DIS"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_in_left_2"/>
<if test="null != list and list.size()>0">
and SAR_STANDARDS_INFO.ID in
<foreach item="id" collection="list" open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
<if test='(page.orderByA != null and page.orderByA != "" and page.order1 != null and page.order1 != "")
or (page.standType != null and page.standType != "") '>
<include refid="standSort_in"/>
</if>
limit ${page.pager.startIndex-1},${page.pageSize}
</select>
<!--FIELD(SAR_STANDARDS_INFO.issue_time,'已发布'), FIELD(SAR_STANDARDS_INFO.issue_time,'TBD'), FIELD(SAR_STANDARDS_INFO.issue_time,'N/A') ,-->
<!--if(isnull(SAR_STANDARDS_INFO.issue_time),0,1) desc ,-->
<!-- 分页查询条件查询一共有多少条数据,配合分页 -->
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select count(1) from (select count(*) from SAR_STANDARDS_INFO
<!-- left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)-->
<include refid="SarStandardsInfo_in_left"/>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="selectHighLawsCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select count(1) from (select count(*) from SAR_STANDARDS_INFO
<!-- left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)-->
<include refid="SarStandardsInfo_in_left"/>
<if test="null != list and list.size()>0">
and SAR_STANDARDS_INFO.ID in
<foreach item="id" collection="list" open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="getSarStandardsInfoCountWk1" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select count(1) from (select count(*) from SAR_STANDARDS_INFO
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
<include refid="SarStandardsInfo_in_left_wk"/>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="selectByPrimaryKeyAndModifyTime" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
select
<include refid="Base_Column_List"/>
from SAR_STANDARDS_INFO
where id = #{id} and valid_flag=0
<if test="modifyTime != null">
and (modify_time &gt; #{modifyTime} or modify_time &lt; #{modifyTime}) a
</if>
</select>
<!-- 根据标准号查询-->
<select id="selectStandardsByStandnumber" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
select
<include refid="Base_Column_List"/>
from
SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
where SAR_STANDARDS_INFO.valid_flag = 0
<!-- 标准类型 -->
<if test="standType != null">
and stand_type = #{standType}
</if>
<if test="standNumber != null">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
or (stand_name like concat(concat('%',#{standNumber}),'%'))
)
<!-- and (
( ( #{standNumber}) like CONCAT('%',dicstandSort.DIC_TYPE_NAME,'%')
and
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_NUMBER,'%')
and
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_YEAR,'%') and SAR_STANDARDS_INFO.STAND_YEAR != '' )
or (( #{standNumber}) like CONCAT('%',dicstandSort.DIC_TYPE_NAME,'%')
and
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_NUMBER,'%')
)
and SAR_STANDARDS_INFO.STAND_YEAR = ''
) -->
</if>
<if test="sychronId != null">
and id != #{sychronId}
</if>
</select>
<select id="queryStandInfoByList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
FROM sar_standards_info
LEFT JOIN sar_stand_attr_info ssai ON ssai.STAND_ID = SAR_STANDARDS_INFO.ID
WHERE
DATE_FORMAT( LEFT (ssai.SSRQ,10), '%Y-%m-%d') >= DATE_FORMAT(
SAR_STANDARDS_INFO.ISSUE_TIME,
'%Y-%m-%d'
)
AND
sar_standards_info.VALID_FLAG='0'
ORDER BY SAR_STANDARDS_INFO.ISSUE_TIME DESC
LIMIT #{limit}
</select>
<!--AND TEXT_STATUS=#{typeCode}-->
<!-- 查询表中是否存在某字段-->
<select id="selectStandColumn" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_name = 'SAR_STANDARDS_INFO' AND column_name = #{columnName}
</select>
<!-- 统计更新过的标准数量-->
<select id="selectCounterStandardsCount" resultType="java.lang.Integer" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
SELECT count(1)
FROM SAR_STANDARDS_INFO
WHERE STAND_TYPE = #{standType} And Valid_flag = 0
<if test="modifyTime != null">
and MODIFY_TIME > #{modifyTime}
</if>
</select>
<update id="updateByStandNum" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set
stand_state=#{standState} where 1=1 and valid_flag=0
<if test="standSort != null">
and stand_sort = #{standSort}
</if>
<if test="standNumber != null">
and stand_Number = #{standNumber}
</if>
<if test="standYear != null">
and stand_year = #{standYear}
</if>
</update>
<select id="selectStandardsInfoByIdAndRole" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select SAR_STANDARDS_INFO.id
from SAR_STANDARDS_INFO
left join SAR_STAND_MENU on SAR_STANDARDS_INFO.id=SAR_STAND_MENU.stand_id
where SAR_STANDARDS_INFO.valid_flag=0
and SAR_STAND_MENU.valid_flag=0
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<delete id="deleteByPrimaryKeyFlag" parameterType="java.lang.String">
delete from SAR_STANDARDS_INFO
where id = #{id} and valid_flag=1
</delete>
<update id="updateReplacedNumById" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set REPLACED_STAND_NUM = #{replacedStandNum} where id = #{id}
</update>
<update id="updateCitedStandById" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
update SAR_STANDARDS_INFO set CITED_STAND = #{citedStand} where id = #{id}
</update>
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select a.* from (
select<include refid="Base_Column_List_Export_Show"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_Where_Export_Clause"/>
GROUP BY <include refid="Group_Column_List_Export_Show"/>
) a
order by
<if test='orderByA != null and orderByA != "" and order1 != null and order1 != ""'>
${orderByA} ${order1},
</if>
<include refid="standSort_out"/>
a.STAND_NUMBER ASC,a.STAND_YEAR DESC,a.id
</select>
<select id="selectStandardsInfoByKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List_Show"/>
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
where SAR_STANDARDS_INFO.id = #{id}
GROUP BY <include refid="Group_Column_List_Show"/>
</select>
<select id="selectRecommendStand" resultType="com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select tmp_tb.* from
(select
if(
SAR_STANDARDS_INFO.STAND_YEAR='',
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
) as numberShow,
SAR_STANDARDS_INFO.stand_name as nameShow,
SAR_STANDARDS_INFO.id,
concat(SAR_STANDARDS_INFO.stand_type,'_STAND') as typeShow
from SAR_STANDARDS_INFO
where SAR_STANDARDS_INFO.valid_flag = '0'
<if test="id != null">
and id != #{id}
</if>
<!-- 标准种类-->
<if test="standSort != null">
and stand_sort = #{standSort}
</if>
<if test="standNumber != null">
or stand_number like concat(concat('%',#{standNumber}),'%')
</if>
<if test="standName != null">
or stand_name like concat(concat('%',#{standName}),'%')
</if>
order by modify_time desc
) tmp_tb limit 0,5
</select>
<select id="countReplaceMsg" resultType="java.lang.String" parameterType="java.lang.String">
SELECT SAR_STANDARDS_INFO.stand_state
FROM SAR_STANDARDS_INFO
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
WHERE SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{standNum}),'%') and SAR_STANDARDS_INFO.valid_flag=0
</select>
<select id="selectStandToUpState" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,
SAR_STAND_ATTR_INFO.XCXSSRQ as allPutTime
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 and dicstandSort.dic_id='JKSADFH564S')
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0 and dicstandState.DIC_TYPE_NAME!=#{stateName}
and SAR_STAND_ATTR_INFO.XCXSSRQ != ''
</select>
<select id="selectStandToUpRepState" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,dicstandState.DIC_TYPE_NAME as standStateShow,SAR_STAND_ATTR_INFO.DTBJH as replace_stand_num
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 and dicstandSort.dic_id='JKSADFH564S')
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0 and dicstandState.DIC_TYPE_NAME != ''
and SAR_STAND_ATTR_INFO.DTBJH != ''
</select>
<select id="selectStandToUpRepAndTime" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>,dicstandState.DIC_TYPE_NAME as standStateShow,
SAR_STAND_ATTR_INFO.DTBJH as replace_stand_num,
concat(SAR_STAND_ATTR_INFO.XCXSSRQ,',',SAR_STAND_ATTR_INFO.ZCCSSRQ) as allPutTime
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 and dicstandSort.dic_id='JKSADFH564S')
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where SAR_STANDARDS_INFO.valid_flag=0
and SAR_STAND_ATTR_INFO.DTBJH != ''
and (SAR_STAND_ATTR_INFO.XCXSSRQ != '' or SAR_STAND_ATTR_INFO.ZCCSSRQ != '')
</select>
<select id="selectIsExit" resultType="java.lang.Integer">
select count(*) from SAR_STANDARDS_INFO where id = #{id} and valid_flag != 0
</select>
<update id="updateStateById" parameterType="java.lang.String">
update SAR_STANDARDS_INFO set stand_state = #{state}
where id in
<foreach item="item" collection="list" open="(" separator="," close=")" index="index">
#{item}
</foreach>
</update>
<update id="updateISRELATEACCESSById">
UPDATE sar_standards_info set IS_RELATE_ACCESS = #{IS_RELATE_ACCESS} WHERE ID IN
<foreach collection="list" item="id" index="index" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="selectStandardsInfoByIdAndRoleAll" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select SAR_STANDARDS_INFO.id
from SAR_STANDARDS_INFO
where
SAR_STANDARDS_INFO.valid_flag=1
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
</select>
<select id="selectStandardsInfoBynumber" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select * from
(select tmp_tb.* from
(select
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL
from SAR_STANDARDS_INFO
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null and dicstandSort.dic_id='JKSADFH564S')
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
left join TS_PERSON_COLLECT on (TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO.id and TS_PERSON_COLLECT.VALID_FLAG=0)
where 1=1
<if test="standNumber != null">
and
concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) = #{standNumber}
</if>
<if test="id != null">
and SAR_STANDARDS_INFO.id = #{id}
</if>
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL
order by SAR_STANDARDS_INFO.issue_time is null, SAR_STANDARDS_INFO.issue_time desc,SAR_STANDARDS_INFO.id
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="selectIdFormDTBZH" resultType="java.lang.String">
SELECT ID FROM sar_standards_info as sarInfo
WHERE
VALID_FLAG = '0'
AND
(
REPLACE (
concat(
sarInfo.STAND_SORT,
' ',
sarInfo.STAND_NUMBER,
'-',
sarInfo.STAND_YEAR
),
' ',
''
) = REPLACE ( #{DTBZHCode},' ', '')
AND sarInfo.STAND_YEAR != ''
)
OR (
REPLACE (
concat(sarInfo.STAND_SORT,sarInfo.STAND_NUMBER),
' ',
''
) = REPLACE ( #{DTBZHCode},' ', '')
)
</select>
<select id="dealWithDS" resultType="com.adc.da.slrs.sarStandardsInfo.entity.DSarStandardDTO">
SELECT ss.ID , ss.TEXT_STATUS , ssa.SSRQ from sar_standards_info ss
LEFT JOIN sar_stand_attr_info ssa ON ssa.STAND_ID = ss.id
<where>
1=1 and ss.valid_flag = 0 and ssa.valid_flag = 0
<if test="type != null">
and ss.STAND_TYPE = #{type}
</if>
<if test=" null != status and status.size() >0 ">
and ss.TEXT_STATUS in
<foreach item="texts" collection="status" open="(" separator="," close=")" index="index">
#{texts}
</foreach>
</if>
</where>
</select>
</mapper>