Merge branch 'develop_master' into origin/Three

This commit is contained in:
Superman_Main
2021-12-08 15:49:59 +08:00
123 changed files with 5770 additions and 494 deletions
@@ -17,7 +17,10 @@
wg_leader,
draft_time,
release_time,
unit
unit,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
</sql>
<resultMap id="BaseInfoMap" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
<id property="id" column="id"></id>
@@ -206,4 +209,12 @@
#{id}
</foreach>
</delete>
<select id="selectPageByName" resultMap="BaseInfoMap">
select <include refid="BaseInfo"></include> from es_revise_plan
where es_name = #{esName}
<if test="id != null and id != '' ">
and id != #{id}
</if>
</select>
</mapper>
@@ -0,0 +1,5 @@
<?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.evaluationIndex.dao.EvaluationIndexDao">
</mapper>
@@ -37,19 +37,20 @@
<result column="standSortShow" property="standSortShow" />
<result column="stand_year" property="standYear" />
<result column="text_status_buss" property="textStatusBuss" />
<result column="stand_number" property="standNumber" />
</resultMap>
<!-- SAR_BUSSIONESS_STAND table all fields -->
<sql id="Base_Column_List" >
modify_time, creation_time, valid_flag, stand_status, replaced_stand_num,replace_stand_num,
put_time, issue_time,stand_en_name,stand_name, stand_code, id,apply_country, stand_nature, stand_sort,text_status_buss
put_time, issue_time,stand_en_name,stand_name, stand_code, id,apply_country, stand_nature, stand_sort,text_status_buss,stand_number
</sql>
<sql id="Base_Column_List_show" >
SAR_BUSSIONESS_STAND.modify_time,
SAR_BUSSIONESS_STAND.creation_time, SAR_BUSSIONESS_STAND.valid_flag,
SAR_BUSSIONESS_STAND.apply_country, SAR_BUSSIONESS_STAND.stand_nature,SAR_BUSSIONESS_STAND.stand_sort,SAR_BUSSIONESS_STAND.stand_year,
stand_status, replaced_stand_num,replace_stand_num,put_time,issue_time,stand_en_name,
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,SAR_BUSSIONESS_STAND.text_status_buss
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,SAR_BUSSIONESS_STAND.text_status_buss,SAR_BUSSIONESS_STAND.stand_number
</sql>
<sql id="Group_Column_List_show" >
@@ -168,6 +169,7 @@
<if test="standNature != null" >stand_Nature,</if>
<if test="standSort != null" >stand_sort,</if>
<if test="standYear != null" >stand_year,</if>
<if test="standNumber != null" >stand_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
@@ -187,6 +189,7 @@
<if test="standNature != null" >#{standNature, jdbcType=VARCHAR},</if>
<if test="standSort != null" >#{standSort, jdbcType=VARCHAR},</if>
<if test="standYear != null" >#{standYear, jdbcType=VARCHAR},</if>
<if test="standNumber != null" >#{standNumber, jdbcType=VARCHAR},</if>
</trim>
</insert>
@@ -246,6 +249,9 @@
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
</set>
where id = #{id}
</update>
@@ -301,6 +307,9 @@
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
</set>
where id = #{id}
</update>
@@ -373,7 +382,7 @@
when tmp_tb.stand_code like concat('%', 'Q/QCFLC', '%') THEN 16
ELSE 17
END,
tmp_tb.stand_sort ASC
tmp_tb.stand_sort ASC,CAST(tmp_tb.STAND_NUMBER AS decimal(9,2)) ASC,tmp_tb.STAND_YEAR DESC,tmp_tb.id
</sql>
<sql id="standSort_out">
ORDER BY
@@ -0,0 +1,5 @@
<?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.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao">
</mapper>
@@ -0,0 +1,24 @@
<?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.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao">
<select id="getHistory"
resultType="com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation">
SELECT
`user`.UNAME AS userName,
eva.user_id,
avg(eva.score * iex.weight) AS score,
iex.index_type as valueType
FROM
quality_evaluation AS eva
LEFT JOIN ts_user `user` ON eva.user_id = `user`.USID
LEFT JOIN evaluation_index AS iex ON eva.evaluation_index = iex.id
GROUP BY
userName,
eva.user_id,
index_type
${ew.customSqlSegment}
</select>
</mapper>
@@ -40,9 +40,11 @@
select ts_user.EMAIL,ts_user.ACCOUNT,ts_user.CREATION_TIME,ts_user.DISABLE_FLAG,ts_user.EXT_INFO,ts_user.USID,
ts_user.INSTITUTION_ID,ts_user.INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.POSITION_ID,ts_user.POSITION_NAME,ts_user.SEX,ts_user.SSO_ID,ts_user.STATE,ts_user.UNLOCK_FLAG,ts_user.USER_SOURCE,
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname,
ts_institution.name as unit,ts_institution.id as unitId
from ts_user
WHERE institution_id=#{institutionId}
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
WHERE institution_id=#{institutionId}
<if test="userName != null and userName != '' ">
and ( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
</if>
@@ -44,6 +44,86 @@
#{item}
</foreach>
</where>
UNION ALL
SELECT
a.ID,
a.STAND_CODE AS standNumber,
a.STAND_NAME AS standName,
a.STAND_EN_NAME,
b.NYLXCLASS,
null AS SSRQ,
null AS XCXSSRQGJ,
null AS ZCCSSRQGJ,
null as ZRBM,
null as SYCPX,
null as CYCVPPSBM,
null as CYCVPPSCN,
null as KCCVPPSBM,
null as KCCVPPSCN,
null as typeApplicable,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
null as standYear,
null as issueTime,
null asstandType,
null AS textStatus
FROM
sar_bussioness_stand a
LEFT JOIN sar_buss_stand_attr_info b ON a.ID = b.STAND_ID
LEFT JOIN TS_DICTYPE dicstandSort ON (
dicstandSort.dic_type_code = a.stand_sort
AND dicstandSort.dic_id IS NOT NULL
AND dicstandSort.valid_flag = 0
AND dicstandSort.PARENT_ID IS NULL
)
<where>
a.ID IN
<foreach collection="param1" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION ALL
SELECT
a.ID,
a.LAWS_NUMBER AS standNumber,
a.LAWS_NAME AS standName,
a.LAWS_EN_NAME as STAND_EN_NAME,
b.NYLXLAWS,
b.SSRQLAWS AS SSRQ,
b.XCXSSRQLAWS AS XCXSSRQGJ,
b.ZCXSSRQLAWS AS ZCCSSRQGJ,
b.ZRBMLAWS as ZRBM,
null as SYCPX,
null as CYCVPPSBM,
null as CYCVPPSCN,
null as KCCVPPSBM,
null as KCCVPPSCN,
null as typeApplicable,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
a.LAWS_YEAR as standYear,
a.ISSUE_TIME as issueTime,
null asstandType,
null AS textStatus
FROM
sar_laws_stand_info a
LEFT JOIN sar_laws_attr_info b ON a.ID = b.LAWS_ID
LEFT JOIN TS_DICTYPE dicstandSort ON (
dicstandSort.dic_type_code = a.LAWS_TYPE
AND dicstandSort.dic_id IS NOT NULL
AND dicstandSort.valid_flag = 0
AND dicstandSort.PARENT_ID IS NULL
)
<where>
a.ID IN
<foreach collection="param1" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
</select>
<select id="selectLawsByIdE" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
@@ -99,95 +179,43 @@
order by number
</select>
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and a.STAND_TYPE = #{standType}
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
@@ -196,21 +224,82 @@
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
</select>
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
@@ -7,4 +7,21 @@
INNER JOIN sar_public_idea_all on sar_public_idea_all.idea_id = sar_public_idea.id
WHERE sar_public_idea_all.idea_id IS NOT NULL and sar_public_idea.uniques = #{unique}
</select>
<select id="getAllDataByIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_user.INSTITUTION_NAME as dept_name,sar_public_idea_all.old_text,
sar_public_idea_all.new_text,ts_user.INSTITUTION_ID as dept_id,sar_public_idea_all.part_code,sar_public_idea_all.user_name,
sar_public_idea_all.user_id,sar_public_idea_all.content,sar_public_idea_all.idea_id,sar_public_idea_all.cid
FROM sar_public_idea_all
left join ts_user on sar_public_idea_all.user_id=ts_user.USID
WHERE
sar_public_idea_all.idea_id = #{ideaId}
LIMIT ${(page-1)*size},${page*size}
</select>
<select id="getAllDataByIdeaCount" resultType="java.lang.Integer">
SELECT count(id)
FROM sar_public_idea_all WHERE
idea_id = #{ideaId}
</select>
</mapper>
@@ -39,6 +39,17 @@
</if>
</update>
<update id="updateByProjectIdBath">
update sar_stand_project_library
<if test="id != null">
set detailed_list_version = #{version} where id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<select id="selectCount" resultType="java.lang.Integer">
SELECT
count(
@@ -50,10 +61,10 @@
WHERE
<if test="flag == 1">
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
library.id NOT IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 2">
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
library.id IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 4">
1=1
@@ -109,10 +120,10 @@
ON team.project_code = library.project_number
WHERE
<if test="flag == 1">
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
library.id NOT IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 2">
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
library.id IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 4">
1=1
@@ -174,10 +185,10 @@
ON team.project_code = library.project_number
WHERE
<if test="flag == 1">
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
library.id NOT IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 2">
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
library.id IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id is NOT NULL )
</if>
<if test="flag == 4">
1=1
@@ -349,4 +360,12 @@
<select id="getAllStand" resultType="java.lang.String">
SELECT DISTINCT ID FROM sar_standards_info where VALID_FLAG=0
</select>
<select id="selectListByids" resultType="java.lang.String">
select distinct sar_stand_project_relation.project_id as projectId
from sar_stand_project_relation
where sar_stand_project_relation.stand_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
@@ -31,7 +31,7 @@
</select>
<select id="getSarStandUnqualifiedPage" resultType="com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified">
<select id="getSarStandUnqualifiedPageNew" resultType="com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified">
SELECT
sar_stand_unqualified.*, sar_standards_info.STAND_TYPE as standType
from
@@ -49,13 +49,45 @@
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%')
and (REPLACE(STAND_SERIAL_NUMBER,' ','') like concat(concat('%',REPLACE(#{sar.standSerialNumber},' ','')),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
order by sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
limit #{start},#{end}
</select>
<select id="getSarStandUnqualifiedCount" resultType="java.lang.Integer">
<select id="getSarStandUnqualifiedPage" resultType="com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified">
SELECT
c.*
FROM
(
SELECT b.*,sar_standards_info.STAND_TYPE as standType FROM (
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* FROM
sar_stand_unqualified,(SELECT @i:=0)j
WHERE
close_state = 1
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
</if>
<if test="sar.responsibleUnit != null and sar.responsibleUnit != '' ">
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and (REPLACE(STAND_SERIAL_NUMBER,' ','') like concat(concat('%',REPLACE(#{sar.standSerialNumber},' ','')),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
order by sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
limit #{start},#{end}
)b
left join sar_standards_info on b.STAND_ID = sar_standards_info.id
)c
ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.ITEMS_NUM,1,(SELECT LOCATE('.',CONCAT(c.ITEMS_NUM,'.')))),SIGNED) ,c.rows
</select>
<select id="getSarStandUnqualifiedCountNew" resultType="java.lang.Integer">
SELECT
count(sar_stand_unqualified.ID)
from
@@ -73,8 +105,38 @@
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%')
and (REPLACE(STAND_SERIAL_NUMBER,' ','') like concat(concat('%',REPLACE(#{sar.standSerialNumber},' ','')),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
</select>
<select id="getSarStandUnqualifiedCount" resultType="java.lang.Integer">
SELECT
count(c.ID)
FROM
(
SELECT b.*,sar_standards_info.STAND_TYPE as standType FROM (
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* FROM
sar_stand_unqualified,(SELECT @i:=0)j
WHERE
close_state = 1
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
</if>
<if test="sar.responsibleUnit != null and sar.responsibleUnit != '' ">
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and (REPLACE(STAND_SERIAL_NUMBER,' ','') like concat(concat('%',REPLACE(#{sar.standSerialNumber},' ','')),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
order by sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
)b
left join sar_standards_info on b.STAND_ID = sar_standards_info.id
)c
ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.ITEMS_NUM,1,(SELECT LOCATE('.',CONCAT(c.ITEMS_NUM,'.')))),SIGNED) ,c.rows
</select>
</mapper>
@@ -37,98 +37,95 @@
<sql id="stand_where">
<if test="waringEO.standCode != null and waringEO.standCode != ''">
AND trim(replace(CONCAT(
sarInfo.STAND_SORT,
' ',
sarInfo.STAND_NUMBER,
'-',
sarInfo.STAND_YEAR
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
</if>
<if test="waringEO.standName != null and waringEO.standName != ''">
AND sarInfo.STAND_NAME = #{waringEO.standName}
</if>
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
AND (
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
AND
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
)
</if>
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
AND (
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startSSRQ},
'%Y-%m-%d'
)
<if test="idList != null and idList.size() > 0">
AND
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endSSRQ},
'%Y-%m-%d'
)
)
</if>
warning.ID
IN
<foreach collection="idList" item="id" open="and (" close=")" separator=",">
<!-- 每个遍历需要生成的串 -->
#{id}
</foreach>
</if>
<if test="waringEO.standCode != null and waringEO.standCode != ''">
AND trim(replace(CONCAT(
sarInfo.STAND_SORT,
' ',
sarInfo.STAND_NUMBER,
'-',
sarInfo.STAND_YEAR
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
</if>
<if test="waringEO.standName != null and waringEO.standName != ''">
AND sarInfo.STAND_NAME like concat('%', #{waringEO.standName},'%')
</if>
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
AND (
DATE_FORMAT(sarInfo.PUT_TIME, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
AND
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
)
</if>
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
AND (
sarInfo.ID IN (SELECT DISTINCT law_id FROM warning_date as t WHERE
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(#{waringEO.startSSRQ}, '%Y-%m-%d')
AND
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(#{waringEO.endSSRQ}, '%Y-%m-%d') AND t.time_name = 'SSRQ' )
)
</if>
</sql>
<select id="selectWarningPage" resultMap="resultMap">
SELECT WARNING_RESULT.* FROM
(
SELECT
<include refid="stand_column"/> ,
attr.CLLX AS APPLY_TYPE ,
attr.ZRGCS AS DUTY_ENGINEER ,
NULL AS ITEMS_ID ,
NULL AS ITEMS_NUM ,
NULL AS ITEMS_NAME ,
NULL AS POLICY_ID ,
NULL AS POLICY_NAME ,
MARK ,
POWER,
attr.XCXSSRQ AS XCXSSRQ ,
attr.ZCCSSRQ AS ZCCSSRQ
<include refid="stand_column"/>
,
attr.CLLX AS
APPLY_TYPE ,
attr
.ZRGCS AS DUTY_ENGINEER ,
NULL AS ITEMS_ID ,
NULL AS ITEMS_NUM , NULL AS ITEMS_NAME ,
NULL AS POLICY_ID ,
NULL AS POLICY_NAME ,
MARK ,
POWER,
attr.XCXSSRQ AS XCXSSRQ ,
attr.ZCCSSRQ AS ZCCSSRQ
FROM sar_stand_warning AS warning
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
<where>
POWER = '1'
AND (MARK = 'stand')
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">
AND attr.CLLX LIKE CONCAT('%', #{waringEO.applyType},'%')
<if test="waringEO.applyType != null and waringEO.applyType != ''">AND attr.CLLX LIKE CONCAT('%',
#{waringEO.applyType},'%')
</if>
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
AND (
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startXCXSSRQ},
'%Y-%m-%d'
)
AND
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endXCXSSRQ},
'%Y-%m-%d'
)
sarInfo.ID IN (SELECT DISTINCT law_id FROM warning_date as t WHERE
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') between DATE_FORMAT(#{waringEO.startXCXSSRQ}, '%Y-%m-%d') AND DATE_FORMAT(#{waringEO.endXCXSSRQ}, '%Y-%m-%d')
AND t.time_name = 'XCXSSRQ' )
)
</if>
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
AND (
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startZCCSSRQ},
'%Y-%m-%d'
)
AND
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endZCCSSRQ},
'%Y-%m-%d'
)
sarInfo.ID IN (SELECT DISTINCT law_id FROM warning_date as t WHERE
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') between DATE_FORMAT(#{waringEO.startZCCSSRQ}, '%Y-%m-%d') AND DATE_FORMAT(#{waringEO.startZCCSSRQ}, '%Y-%m-%d')
AND t.time_name = 'ZCCSSRQ' )
)
</if>
</where>
@@ -156,7 +153,7 @@
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
<where>
POWER = '1'
AND (MARK = 'item')
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">
AND items.APPLY_ARCTIC LIKE CONCAT('%', #{waringEO.applyType},'%')
@@ -164,21 +161,28 @@
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
AND (
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(#{waringEO.startXCXSSRQ},'%Y-%m-%d')
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') between DATE_FORMAT(#{waringEO.startXCXSSRQ},'%Y-%m-%d')
AND
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(#{waringEO.endXCXSSRQ},'%Y-%m-%d')
DATE_FORMAT(#{waringEO.endXCXSSRQ},'%Y-%m-%d')
)
</if>
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
AND(
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(#{waringEO.startZCCSSRQ},'%Y-%m-%d')
AND
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(#{waringEO.endZCCSSRQ},'%Y-%m-%d' )
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') between DATE_FORMAT(#{waringEO.startZCCSSRQ},'%Y-%m-%d') AND DATE_FORMAT(#{waringEO.endZCCSSRQ},'%Y-%m-%d' )
)
</if>
</where>
)
WARNING_RESULT
LEFT JOIN
(
SELECT law_id,MIN(SSRQ) SSRQ_MIN FROM warning_date
GROUP BY warning_date.law_id
) warning_date
ON warning_date.law_id = WARNING_RESULT.STAND_ID
ORDER BY warning_date.SSRQ_MIN
</select>
@@ -3,33 +3,24 @@
<mapper namespace="com.adc.da.scheduled.dao.SarStandardInfoDao">
<!-- Result Map-->
<resultMap id="resultMap" type="com.adc.da.scheduled.entity.WarningEO" >
<id column="ID" property="standId" />
<result column="STAND_NUMBER" property="standNum" />
<result column="STAND_NAME" property="standName" />
<result column="STAND_SORT" property="standSort"/>
<result column="STAND_YEAR" property="standYear"/>
<result column="XCXSSRQ" property="XCXSSRQ"/>
<result column="ZCCSSRQ" property="ZCCSSRQ"/>
<result column="SSRQ" property="SSRQ"/>
<result column="CLLX" property="applyType" />
<result column="STAND_TYPE" property="standType" />
<result column="ZRGCS" property="dutyEngineer" />
</resultMap>
<!-- <resultMap id="resultMap" type="com.adc.da.scheduled.entity.WarningEO" >-->
<!-- <id column="ID" property="standId" />-->
<!-- <result column="STAND_NUMBER" property="standNum" />-->
<!-- <result column="STAND_NAME" property="standName" />-->
<!-- <result column="STAND_SORT" property="standSort"/>-->
<!-- <result column="STAND_YEAR" property="standYear"/>-->
<!-- <result column="XCXSSRQ" property="XCXSSRQ"/>-->
<!-- <result column="ZCCSSRQ" property="ZCCSSRQ"/>-->
<!-- <result column="SSRQ" property="SSRQ"/>-->
<!-- <result column="CLLX" property="applyType" />-->
<!-- <result column="STAND_TYPE" property="standType" />-->
<!-- <result column="ZRGCS" property="dutyEngineer" />-->
<!-- </resultMap>-->
<!-- 查询条件 -->
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
<select id="selectWithinTerm" resultType="java.lang.String" parameterType="com.adc.da.scheduled.entity.TermDTO">
SELECT
info.ID,
info.STAND_SORT,
info.STAND_YEAR,
info.STAND_NUMBER,
info.STAND_NAME,
info.STAND_TYPE,
attrInfo.CLLX,
attrInfo.ZRGCS,
attrInfo.SSRQ,
attrInfo.${str}
info.ID
FROM
sar_standards_info AS info
JOIN sar_stand_attr_info AS attrInfo ON info.id = attrinfo.stand_id
@@ -19,7 +19,7 @@
<result column="STAND_YEAR" property="standYear"/>
</resultMap>
<!-- 查询条件 -->
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.TermDTO">
SELECT
items.ID,
items.ITEMS_NUM,
@@ -4,30 +4,105 @@
<insert id="ignoreInsert" parameterType="java.util.LinkedList">
REPLACE INTO sar_stand_warning (ID,STAND_ID, STAND_TYPE, STAND_CODE,STAND_NAME,PUT_TIME,APPLY_TYPE,DUTY_ENGINEER,ITEMS_ID,ITEMS_NUM,ITEMS_NAME,POLICY_ID,POLICY_NAME,MARK,POWER)
REPLACE INTO sar_stand_warning (ID,STAND_ID,ITEMS_ID,POLICY_ID,MARK,POWER)
VALUES
<if test="warningEOS !=null and warningEOS.size()!=0">
<foreach collection="warningEOS" item="item" index="index" separator=",">
(
#{item.id}
,#{item.standId}
,#{item.standType}
,#{item.standCode}
,#{item.standName}
,#{item.putTime}
,#{item.applyType}
,#{item.dutyEngineer}
,#{item.itemsId}
,#{item.itemsNum}
,#{item.itemsName}
,#{item.policyId}
,#{item.policyName}
,#{item.mark}
,#{item.power}
)
</foreach>
</if>
</insert>
<delete id="autoCancelWarning">
UPDATE sar_stand_warning
SET POWER ='0'
WHERE
STAND_ID IN (
SELECT
law_id
FROM
warning_date
WHERE
DATE_FORMAT(SSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d')
UNION
SELECT
ID
FROM
sar_standards_info
WHERE
DATE_FORMAT(PUT_TIME, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d')
UNION
SELECT
STAND_ID
FROM
sar_stand_items
WHERE
DATE_FORMAT(XCXSSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d')
OR DATE_FORMAT(ZCCSSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d')
)
</delete>
<select id="getWarningId" resultType="com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO">
SELECT
law_id as STAND_ID,
'-1' AS itemsId,
'stand' AS mark,
'1' as power
FROM
warning_date AS warning
WHERE
DATE_FORMAT(warning.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
UNION
SELECT
STAND_ID,
ID AS itemsId,
'item' AS mark,
'1' as power
FROM
sar_stand_items AS item
WHERE
DATE_FORMAT(item.XCXSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
OR
DATE_FORMAT(item.ZCCSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</select>
<select id="getWarningDate" resultType="com.adc.da.slrs.sarStandWarning.entity.WarningDate">
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
(
select attr.STAND_ID as lawId,'SSRQ' as timeName,
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
UNION ALL
select attr.STAND_ID as lawId,'XCXSSRQ' as timeName,
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.XCXSSRQ) - length(replace(attr.SSRQ,',',''))+1)
UNION ALL
select attr.STAND_ID as lawId,'ZCCSSRQ' as timeName,
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
) as T
WHERE
DATE_FORMAT(T.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</select>
</mapper>
@@ -14,4 +14,75 @@
and sar_interpretation_national_standard.STAND_NAME=#{find.standName}
and sar_interpretation_national_standard.INTERPRETATION_TIME = #{find.interpretationTime}
</update>
<select id="getAllDatas"
resultType="com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard">
SELECT c.* FROM (
SELECT
(@i:=@i+1) as rows,
id,
INTERPRETATION_TIME,
STAND_NUMBER,
specific_item,
compared_with_previous,
CREATION_USER,
CREATION_TIME,
VALID_FLAG,
LAST_VERSION_NUMBER,
risk_degree,
compliance_state,
INTERPRETATION_STATE,
STAND_TYPE,
MODIFY_TIME,
STAND_SORT,
STAND_ID,
STAND_NAME,
core_technical_requirement
FROM
sar_interpretation_national_standard ,(SELECT @i:=0)j
WHERE
1=1
<if test="interpretationTime!=null ">
and INTERPRETATION_TIME = #{interpretationTime}
</if>
<if test="standId!=null and standId!=''">
AND STAND_ID = #{standId}
</if>
<if test="standNumber!=null and standNumber!=''">
AND STAND_NUMBER like concat(concat('%',#{standNumber}),'%')
</if>
<if test="standName!=null and standName!=''">
AND STAND_NAME like concat(concat('%',#{standName}),'%')
</if>
<if test="specificItem!=null and specificItem!=''">
AND specific_item like concat(concat('%',#{specificItem}),'%')
</if>
ORDER BY STAND_ID, specific_item
LIMIT ${(current-1)*size},${current*size}
) c ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.specific_item,1,(SELECT LOCATE('.',CONCAT(c.specific_item,'.')))),SIGNED) ,rows
</select>
<select id="getAllDatasCout" resultType="java.lang.Integer">
SELECT
count(id)
FROM
sar_interpretation_national_standard
WHERE
1=1
<if test="interpretationTime!=null ">
and INTERPRETATION_TIME = #{interpretationTime}
</if>
<if test="standId!=null and standId!=''">
AND STAND_ID = #{standId}
</if>
<if test="standNumber!=null and standNumber!=''">
AND STAND_NUMBER like concat(concat('%',#{standNumber}),'%')
</if>
<if test="standName!=null and standName!=''">
AND STAND_NAME like concat(concat('%',#{standName}),'%')
</if>
<if test="specificItem!=null and specificItem!=''">
AND specific_item like concat(concat('%',#{specificItem}),'%')
</if>
</select>
</mapper>
@@ -3,5 +3,64 @@
<mapper namespace="com.adc.da.slrs.sarStandardComplianceAssessResult.dao.SarStandardComplianceProductAssessDao">
<select id="selectPages"
resultType="com.adc.da.slrs.sarStandardComplianceAssessResult.entity.unCountDTO">
select PRODUCT_NAME as productName,sar_stand_project_library.project_group as projectGroup,
sar_stand_project_library.id as sarId,
sar_stand_project_library.product_line as productLine,sar_stand_project_library.project_number as productId,
sar_stand_project_library.project_manager as projectManager,ts_user.UNAME as uName,
(SELECT count(*) FROM sar_stand_unqualified WHERE sar_stand_unqualified.STAND_ID = #{product.standId}) unCount
FROM
sar_stand_project_library
LEFT JOIN sar_stand_unqualified ON sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user ON ts_user.USID = sar_stand_project_library.project_manager
WHERE
sar_stand_project_library.project_number in ( SELECT product_id FROM sar_standard_compliance_product_assess WHERE STAND_ID=#{product.standId})
AND CLOSE_STATE = '1'
group by
PRODUCT_NAME,
sar_stand_project_library.project_group,
sar_stand_project_library.product_line,
sar_stand_project_library.project_manager,
sar_stand_project_library.project_number,
sar_stand_project_library.id,
ts_user.UNAME
<if test="null != product.productName and ''!= product.productName">
and product_name like concat(concat('%',#{product.productName}),'%')
</if>
<if test="null != product.productId and ''!= product.productId">
and project_number like concat(concat('%',#{product.productId}),'%')
</if>
ORDER BY
PRODUCT_NAME ASC
limit ${(page-1)*pageSize},${page*pageSize}
</select>
<select id="selectPagesCount"
resultType="java.lang.Integer">
select count(sar_stand_unqualified.product_id)
FROM
sar_stand_project_library
LEFT JOIN sar_stand_unqualified ON sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user ON ts_user.USID = sar_stand_project_library.project_manager
WHERE
sar_stand_project_library.project_number in (SELECT product_id FROM sar_standard_compliance_product_assess WHERE STAND_ID=#{product.standId})
AND CLOSE_STATE = '1'
group by
PRODUCT_NAME,
sar_stand_project_library.project_group,
sar_stand_project_library.product_line,
sar_stand_project_library.project_manager,
sar_stand_project_library.project_number,
sar_stand_project_library.id,
ts_user.UNAME
<if test="null != product.productName and ''!= product.productName">
and product_name like concat(concat('%',#{product.productName}),'%')
</if>
<if test="null != product.productId and ''!= product.productId">
and project_number like concat(concat('%',#{product.productId}),'%')
</if>
ORDER BY
PRODUCT_NAME ASC
</select>
</mapper>
@@ -79,19 +79,19 @@
dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow,
(
CASE
WHEN SAR_STAND_ATTR_INFO.SSRQ ='' THEN '9999-01-01'
WHEN SAR_STAND_ATTR_INFO.SSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.SSRQ
END
) AS SSRQ,
(
CASE
WHEN SAR_STAND_ATTR_INFO.ZCCSSRQ ='' THEN '9999-01-01'
WHEN SAR_STAND_ATTR_INFO.ZCCSSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.ZCCSSRQ
END
) AS ZCCSSRQ,
(
CASE
WHEN SAR_STAND_ATTR_INFO.XCXSSRQ ='' THEN '9999-01-01'
WHEN SAR_STAND_ATTR_INFO.XCXSSRQ ='' THEN ''
ELSE SAR_STAND_ATTR_INFO.XCXSSRQ
END
) AS XCXSSRQ
@@ -441,10 +441,11 @@
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
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 != '')
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
and SAR_STANDARDS_INFO.STAND_YEAR = '')
(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>
@@ -757,16 +758,17 @@
(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}),'%'))
)
<!-- 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}),'%')
<!-- 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}),'%')
@@ -884,9 +886,14 @@
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
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 != '')
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}),'%'),' ',''))
)
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
@@ -1038,16 +1045,28 @@
</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 != '')
( #{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 = '')
)
)
and SAR_STANDARDS_INFO.STAND_YEAR = ''
) -->
</if>
<if test="sychronId != null">
and id != #{sychronId}
@@ -1254,6 +1273,13 @@
#{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
@@ -205,7 +205,7 @@
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="modifyUser != null" >modify_user,</if>
<if test="editFlag != null" >edit_flag,</if>
<if test="fo != null" >fo,</if>
<if test="dutyEngineer != null" >duty_engineer,</if>
<if test="claimType != null" >claim_type,</if>
@@ -233,7 +233,7 @@
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="modifyUser != null" >#{modifyUser, jdbcType=VARCHAR},</if>
<if test="editFlag != null" >#{editFlag,jdbcType=VARCHAR}</if>
<if test="fo != null" >#{fo, jdbcType=VARCHAR},</if>
<if test="dutyEngineer != null" >#{dutyEngineer, jdbcType=VARCHAR},</if>
<if test="claimType != null" >#{claimType, jdbcType=VARCHAR},</if>
@@ -3,19 +3,21 @@
<mapper namespace="com.adc.da.slrs.wgDept.dao.WgDeptDao">
<select id="researchDatas" resultType="com.adc.da.slrs.wgDept.entity.WgDeptShow">
select wg_dept.* ,ts_user.UNAME as name ,ts_user.PHONE as phone ,ts_user.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName
select wg_dept.* ,ts_user.UNAME as name ,wg_dept.PHONE as phone ,wg_dept.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName ,ts_institution.name as unitName , ts_institution.id as unit
from wg_dept
left join ts_user on ts_user.ACCOUNT = wg_dept.dept_people_id
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
where wg_dept.wg_id =#{data}
</select>
<select id="researchAllDatas" resultType="com.adc.da.slrs.wgDept.entity.WgDeptShow">
select wg_dept.* ,ts_user.UNAME as name ,ts_user.PHONE as phone ,ts_user.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName
select wg_dept.* ,ts_user.UNAME as name ,wg_dept.PHONE as phone ,wg_dept.EMAIL as email,ts_user.INSTITUTION_ID as deptId
,ts_user.INSTITUTION_NAME as deptName ,ts_institution.name as unitName , ts_institution.id as unit
from wg_dept
left join ts_user on ts_user.ACCOUNT = wg_dept.dept_people_id
left join wg_work_group on wg_work_group.id = wg_dept.wg_id
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
where wg_work_group.type = #{type}
</select>
@@ -3,7 +3,7 @@
<mapper namespace="com.adc.da.slrs.wgNetInfo.dao.WgNetInfoDao">
<select id="researchDatas" resultType="com.adc.da.slrs.wgNetInfo.entity.WgNetInfoDTO">
select wg_net_info.net_id,ts_user.UNAME as name ,ts_user.PHONE as phone, ts_user.EMAIL as email
select wg_net_info.net_id,ts_user.UNAME as name ,wg_net_info.PHONE as phone, wg_net_info.EMAIL as email
,wg_net_info.id,wg_net_info.wg_id , wg_net_info.join_id
from wg_net_info
left join ts_user on ts_user.ACCOUNT = wg_net_info.net_id
@@ -11,7 +11,7 @@
</select>
<select id="researchAllDatas" resultType="com.adc.da.slrs.wgNetInfo.entity.WgNetInfoDTO">
select wg_net_info.net_id,ts_user.UNAME as name ,ts_user.PHONE as phone, ts_user.EMAIL as email
select wg_net_info.net_id,ts_user.UNAME as name ,wg_net_info.PHONE as phone, wg_net_info.EMAIL as email
,wg_net_info.id,wg_net_info.wg_id , wg_net_info.join_id
from wg_net_info
left join ts_user on ts_user.ACCOUNT = wg_net_info.net_id