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
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
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
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
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
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
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
and id ${idOperator} #{id}
and stand_type ${standTypeOperator} #{standType}
and country ${countryOperator} #{country}
and stand_sort ${standSortOperator} #{standSort}
and stand_number ${standNumberOperator} #{standNumber}
and stand_year ${standYearOperator} #{standYear}
and stand_name ${standNameOperator} #{standName}
and stand_en_name ${standEnNameOperator} #{standEnName}
and stand_state ${standStateOperator} #{standState}
and stand_nature ${standNatureOperator} #{standNature}
and issue_time ${issueTimeOperator} #{issueTime}
and issue_time >= #{issueTime1}
and issue_time <= #{issueTime2}
and put_time ${putTimeOperator} #{putTime}
and put_time >= #{putTime1}
and put_time <= #{putTime2}
and synopsis ${synopsisOperator} #{synopsis}
and replace_stand_num ${replaceStandNumOperator} #{replaceStandNum}
and replaced_stand_num ${replacedStandNumOperator} #{replacedStandNum}
and creation_user ${creationUserOperator} #{creationUser}
and valid_flag ${validFlagOperator} #{validFlag}
and creation_time ${creationTimeOperator} #{creationTime}
and creation_time >= #{creationTime1}
and creation_time <= #{creationTime2}
and modify_time ${modifyTimeOperator} #{modifyTime}
and modify_time >= #{modifyTime1}
and modify_time <= #{modifyTime2}
and is_relate_access = #{isRelateAccess}
and text_status = #{textStatus}
and stand_system = #{standSystem}
insert into SAR_STANDARDS_INFO
id,stand_type,country,stand_sort,stand_number,stand_year,stand_name,stand_en_name,stand_state,stand_nature,issue_time,put_time,synopsis,replace_stand_num,replaced_stand_num,creation_user,valid_flag,creation_time,modify_time,is_relate_access,cite_stand,cited_stand,text_status,stand_system,#{id, jdbcType=VARCHAR},#{standType, jdbcType=VARCHAR},#{country, jdbcType=VARCHAR},#{standSort, jdbcType=VARCHAR},#{standNumber, jdbcType=VARCHAR},#{standYear, jdbcType=VARCHAR},#{standName, jdbcType=VARCHAR},#{standEnName, jdbcType=VARCHAR},#{standState, jdbcType=VARCHAR},#{standNature, jdbcType=VARCHAR},#{issueTime, jdbcType=VARCHAR},#{putTime, jdbcType=TIMESTAMP},#{synopsis, jdbcType=CLOB},#{replaceStandNum, jdbcType=CLOB},#{replacedStandNum, jdbcType=VARCHAR},#{creationUser, jdbcType=VARCHAR},#{validFlag, jdbcType=VARCHAR},#{creationTime, jdbcType=TIMESTAMP},#{modifyTime, jdbcType=TIMESTAMP},#{isRelateAccess, jdbcType=VARCHAR},#{citeStand, jdbcType=VARCHAR},#{citedStand, jdbcType=VARCHAR},#{textStatus, jdbcType=VARCHAR},#{standSystem, jdbcType=VARCHAR},
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 SAR_STANDARDS_INFO
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},
is_relate_access = #{isRelateAccess},
cite_stand = #{citeStand},
cited_stand = #{citedStand},
text_status = #{textStatus},
stand_system = #{standSystem},
where id = #{id}
delete from SAR_STANDARDS_INFO
where id = #{value}
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
and stand_type = #{standType}
and country = #{country}
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 (stand_name like concat(concat('%',#{standNumber}),'%'))
)
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}),'%')
and stand_en_name like concat(concat('%',#{standEnName}),'%')
and stand_state = #{standState}
and stand_nature = #{standNature}
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
and is_relate_access = #{isRelateAccess}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STANDARDS_INFO.id in
#{item}
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
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}
)
and SAR_STAND_ATTR_INFO.GXHBQ is not null
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
and (${advanceSearchStr})
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
and stand_type = #{standType}
and country = #{country}
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 (stand_name like concat(concat('%',#{standNumber}),'%'))
)
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}),'%')
and stand_en_name like concat(concat('%',#{standEnName}),'%')
and stand_state = #{standState}
and stand_nature = #{standNature}
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
and is_relate_access = #{isRelateAccess}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STANDARDS_INFO.id in
#{item}
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
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}
)
and SAR_STAND_ATTR_INFO.GXHBQ is not null
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
and (${advanceSearchStr})
ORDER BY
${page.orderByA} ${page.order1},
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
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
sar_standards_info.stand_sort ASC
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,
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,
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,
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,
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 = '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
and stand_type = #{page.standType}
and SAR_STANDARDS_INFO.MODIFY_TIME between DATE_SUB(NOW(),INTERVAL 7 day) and DATE_SUB(NOW(),INTERVAL -1 day)
and country = #{page.country}
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}),'%'),' ',''))
or (trim(replace(stand_name,' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) )
)
)
and stand_name like concat(concat('%',#{page.standName}),'%')
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
and stand_state = #{page.standState}
and stand_nature = #{page.standNature}
and SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{page.replaceStandNum}),'%')
and replaced_stand_num like concat(concat('%',#{page.replacedStandNum}),'%')
and is_relate_access = #{page.isRelateAccess}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STAND_MENU.MENU_ID not in
#{item}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STANDARDS_INFO.id in
#{item}
and SAR_STANDARDS_INFO.stand_sort = #{page.standSort}
and SAR_STANDARDS_INFO.STAND_YEAR = #{page.standYear}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{page.issueTime}
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')
AND dbms_lob.instr(SYNOPSIS, #{page.synopsis} ,1,1) > 0
and SAR_STANDARDS_INFO.TEXT_STATUS = #{page.textStatus}
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{page.isRelateAccess}
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}
)
and SAR_STAND_ATTR_INFO.GXHBQ is not null
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{page.labelMenuId}),'%')
and SAR_STAND_ATTR_INFO.CLLX = #{page.applyArctic}
and (${page.advanceSearchStr})
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 = '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
and stand_type = #{page.standType}
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},' ',''))
)
)
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
and stand_type = #{page.standType}
and country = #{page.country}
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 stand_name like concat(concat('%',#{page.standName}),'%')
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
and stand_state = #{page.standState}
and stand_nature = #{page.standNature}
and SAR_STAND_ATTR_INFO.DTBJH like concat(concat('%',#{page.replaceStandNum}),'%')
and replaced_stand_num like concat(concat('%',#{page.replacedStandNum}),'%')
and is_relate_access = #{page.isRelateAccess}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STANDARDS_INFO.id in
#{item}
and SAR_STANDARDS_INFO.stand_sort = #{page.standSort}
and SAR_STANDARDS_INFO.STAND_YEAR = #{page.standYear}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{page.issueTime}
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')
AND dbms_lob.instr(SYNOPSIS, #{page.synopsis} ,1,1) > 0
and SAR_STANDARDS_INFO.TEXT_STATUS = #{page.textStatus}
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{page.isRelateAccess}
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}
)
and SAR_STAND_ATTR_INFO.GXHBQ is not null
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{page.labelMenuId}),'%')
and SAR_STAND_ATTR_INFO.CLLX = #{page.applyArctic}
and (${page.advanceSearchStr})
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
and stand_type = #{standType}
and country = #{country}
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}),'%'),' ','')) )
)
and stand_name like concat(concat('%',#{standName}),'%')
and stand_en_name like concat(concat('%',#{standEnName}),'%')
and stand_state = #{standState}
and stand_nature = #{standNature}
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
and is_relate_access = #{isRelateAccess}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STAND_MENU.MENU_ID in
#{item}
and SAR_STANDARDS_INFO.id in
#{item}
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
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}
)
update SAR_STANDARDS_INFO set
stand_state=#{standState} where 1=1 and valid_flag=0
and stand_sort = #{standSort}
and stand_Number = #{standNumber}
and stand_year = #{standYear}
delete from SAR_STANDARDS_INFO
where id = #{id} and valid_flag=1
update SAR_STANDARDS_INFO set REPLACED_STAND_NUM = #{replacedStandNum} where id = #{id}
update SAR_STANDARDS_INFO set CITED_STAND = #{citedStand} where id = #{id}
update SAR_STANDARDS_INFO set stand_state = #{state}
where id in
#{item}
UPDATE sar_standards_info set IS_RELATE_ACCESS = #{IS_RELATE_ACCESS} WHERE ID IN
#{id}