Merge branch 'develop_master' into develop_migration

This commit is contained in:
396572590@qq.com
2022-06-30 09:31:51 +08:00
37 changed files with 622 additions and 185 deletions
@@ -6,9 +6,10 @@
SELECT
DISTINCT
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
aq.STANDARD_NAME
aq.STANDARD_NAME,
MAX(aq.QUESTION_TIME) as questionTime
FROM ask_questions aq
LEFT JOIN reply ON aq.ID = reply.ASK_ID
LEFT JOIN (SELECT DISTINCT re.ANSWERER,re.ASK_ID FROM reply re) reply ON aq.ID = reply.ASK_ID
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
<where>
@@ -37,6 +38,13 @@
AND reply.ANSWERER = #{askQuestions.answerer}
</if>
</where>
GROUP BY
aq.STANDARD_ID,
aq.CLASSIFICATION,
aq.STANDARD_ENCDOING,
aq.STANDARD_NAME
ORDER BY
questionTime DESC
</select>
<select id="getAskQuestionsByStandardId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
@@ -49,6 +57,7 @@
AND aq.STANDARD_ID = #{standardId}
</if>
</where>
order by QUESTION_TIME desc
</select>
<select id="getArchiveAskQuestions" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
@@ -82,9 +91,9 @@
<select id="getReplyDetails" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
SELECT
DISTINCT
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
aq.STANDARD_NAME
aq.STANDARD_NAME,
MAX(aq.QUESTION_TIME) as questionTime
FROM ask_questions aq
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
@@ -98,6 +107,13 @@
AND aq.CLASSIFICATION = #{askQuestions.classification}
</if>
</where>
GROUP BY
aq.STANDARD_ID,
aq.CLASSIFICATION,
aq.STANDARD_ENCDOING,
aq.STANDARD_NAME
ORDER BY
questionTime DESC
</select>
<select id="getReplyDetailsByStandId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
@@ -118,8 +134,8 @@
<select id="getAskQuestionsBySubscription" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
SELECT
DISTINCT
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME,
MAX(aq.QUESTION_TIME) as questionTime
FROM ask_questions aq
LEFT JOIN reply ON aq.ID = reply.ASK_ID
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
@@ -133,6 +149,13 @@
AND aq.CLASSIFICATION = #{askQuestions.classification}
</if>
</where>
GROUP BY
aq.STANDARD_ID,
aq.CLASSIFICATION,
aq.STANDARD_ENCDOING,
aq.STANDARD_NAME
ORDER BY
questionTime DESC
</select>
<select id="retrieve" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
@@ -206,7 +229,7 @@
</select>
<select id="resemblance" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
SELECT *,
SELECT DISTINCT *,
<foreach item="item" collection="chars" separator="+" open="(" close=")" index="">
(case when PROBLEM_DESCRIPTION like CONCAT('%',#{item},'%') then 1 else 0 end)
</foreach>
@@ -220,6 +243,24 @@
WHERE
ti.`name`='标准法规部'
</select>
<select id="getAskQuestionsNew" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
aq.STANDARD_NAME,aq.STANDARD_ID
FROM ask_questions aq
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
<where>
<if test="ask.standardId !=null and ask.standardId !=''">
AND aq.STANDARD_ID = #{ask.standardId}
</if>
<if test="ask.problemDescription !=null and ask.problemDescription !=''">
AND aq.PROBLEM_DESCRIPTION LIKE concat(concat('%',#{ask.problemDescription}),'%')
</if>
<if test="ask.classification !=null and ask.classification !=''">
AND aq.CLASSIFICATION LIKE concat(concat('%',#{ask.classification}),'%')
</if>
</where>
order by QUESTION_TIME desc
</select>
</mapper>
@@ -31,10 +31,6 @@
and (SAR_STAND_ATTR_INFO.KCCVPPSBM like concat(#{vppsCode},'%') or SAR_STAND_ATTR_INFO.CYCVPPSBM like
concat(#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSCN like concat('%',#{vppsName},'%') or SAR_STAND_ATTR_INFO.CYCVPPSCN like
concat('%',#{vppsName},'%'))
</if>
UNION
SELECT
sar_bussioness_stand.id AS standId,
@@ -53,10 +49,6 @@
and (sar_buss_stand_attr_info.KCVPPSBMBUSS like concat(#{vppsCode},'%') or
sar_buss_stand_attr_info.CYCVPPSBMBUSS like concat(#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (sar_buss_stand_attr_info.KCVPPSCNBUSS like concat('%',#{vppsName},'%') or
sar_buss_stand_attr_info.CYCVPPSCNBUSS like concat('%',#{vppsName},'%'))
</if>
) t
</select>
<select id="searchStandDataThree" resultMap="BaseResultMap">
@@ -3,7 +3,7 @@
<mapper namespace="com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaAllDao">
<select id="getPublicIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_institution.name as dept_name,ts_institution.name as department,sar_public_idea_all.old_text,
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,concat(t3.name,'_',t2.name,'_',ts_institution.name) as dept_name,ts_institution.name as department,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,
sar_public_idea_all.chapter_name as chapterName,sar_public_idea_all.wk_flag,sar_public_idea_all.cause, sar_public_idea_all.state,sar_public_idea_all.source_type as sourceType
@@ -11,6 +11,8 @@
INNER JOIN sar_public_idea_all on sar_public_idea_all.idea_id = sar_public_idea.id
left join ts_user on ts_user.USID = sar_public_idea_all.user_id
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
left join ts_institution t2 on ts_institution.parent_id=t2.id
left join ts_institution t3 on t2.parent_id=t3.id
WHERE sar_public_idea_all.idea_id IS NOT NULL and sar_public_idea.uniques = #{unique}
</select>
@@ -31,7 +33,7 @@
FROM
(
SELECT (@i:=@i+1) as rows,
sar_public_idea_all.id,sar_public_idea_all.reason,ts_institution.name as dept_name,sar_public_idea_all.old_text,
sar_public_idea_all.id,sar_public_idea_all.reason,concat(t3.name,'_',t2.name,'_',ts_institution.name) as dept_name,sar_public_idea_all.old_text,
sar_public_idea_all.wk_flag,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,
@@ -39,6 +41,8 @@
FROM (sar_public_idea_all,(SELECT @i:=0)j)
left join ts_user on sar_public_idea_all.user_id=ts_user.USID
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
left join ts_institution t2 on ts_institution.parent_id=t2.id
left join ts_institution t3 on t2.parent_id=t3.id
WHERE
sar_public_idea_all.idea_id = #{ideaId}
)c
@@ -53,11 +57,13 @@
</select>
<select id="getPublicAllIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,reason,ts_institution.name as
SELECT sar_public_idea_all.id,reason,concat(t3.name,'_',t2.name,'_',ts_institution.name) as
deptName,old_text,new_text,dept_id,part_code,user_name,user_id,content,idea_id,cid,chapter_name,wk_flag,sar_public_idea_all.state,sar_public_idea_all.cause,sar_public_idea_all.source_type as sourceType
FROM sar_public_idea_all
left join ts_user on ts_user.USID=sar_public_idea_all.user_id
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
left join ts_institution t2 on ts_institution.parent_id=t2.id
left join ts_institution t3 on t2.parent_id=t3.id
WHERE sar_public_idea_all.idea_id = #{cid}
<if test="null!=type and type != ''">
and sar_public_idea_all.wk_flag ='1' and sar_public_idea_all.state in ('1','2')
@@ -66,11 +72,13 @@
</select>
<select id="getPublicAllIdeaExport" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,reason,ts_institution.name as
SELECT sar_public_idea_all.id,reason,concat(t3.name,'_',t2.name,'_',ts_institution.name) as
deptName,old_text,new_text,dept_id,part_code,user_name,user_id,content,idea_id,cid,chapter_name,wk_flag,sar_public_idea_all.state,sar_public_idea_all.cause,sar_public_idea_all.source_type as sourceType
FROM sar_public_idea_all
left join ts_user on ts_user.USID=sar_public_idea_all.user_id
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
left join ts_institution t2 on ts_institution.parent_id=t2.id
left join ts_institution t3 on t2.parent_id=t3.id
WHERE cid = #{cid}
<if test="null==type or ''==type">
and sar_public_idea_all.wk_flag is null
@@ -209,7 +209,12 @@
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
<where>
POWER = '1'
AND (MARK = 'stand')
<if test="waringEO.mark != null and waringEO.mark != ''">
AND (MARK = #{mark})
</if>
<if test="waringEO.mark == null or waringEO.mark == ''">
AND (MARK = 'stand')
</if>
AND sarInfo.VALID_FLAG='0'
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">AND attr.CLLX LIKE CONCAT('%',
@@ -255,7 +260,12 @@
LEFT JOIN sar_stand_items AS items ON items.ID = warning.ITEM_ID
<where>
POWER = '1'
AND (MARK = 'item')
<if test="waringEO.mark != null and waringEO.mark != ''">
AND (MARK = #{mark})
</if>
<if test="waringEO.mark == null or waringEO.mark == ''">
AND (MARK = 'item')
</if>
AND sarInfo.VALID_FLAG='0'
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">
@@ -4,7 +4,7 @@
<insert id="ignoreInsert" parameterType="java.util.LinkedList">
REPLACE INTO sar_stand_warning (ID,STAND_ID,ITEMS_ID,POLICY_ID,MARK,POWER)
REPLACE INTO sar_stand_warning (ID,STAND_ID,ITEM_ID,POLICY_ID,MARK,POWER)
VALUES
<if test="warningEOS !=null and warningEOS.size()!=0">
<foreach collection="warningEOS" item="item" index="index" separator=",">
@@ -21,26 +21,11 @@
</insert>
<delete id="autoCancelWarning">
UPDATE sar_stand_warning
SET POWER ='0'
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')
)
STAND_ID IN ( SELECT law_id FROM warning_date WHERE DATE_FORMAT(SSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d'))
OR
ITEMS_ID IN (
SELECT
ITEM_ID
FROM
warning_date
WHERE
DATE_FORMAT(SSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d')
)
ITEM_ID IN ( SELECT ITEM_ID FROM warning_date WHERE DATE_FORMAT(SSRQ, '%Y-%m-%d') &lt; DATE_FORMAT(now(), '%Y-%m-%d') AND ITEM_ID IS NOT NULL )
</delete>
@@ -21,44 +21,59 @@
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
sins.id,
sins.INTERPRETATION_TIME,
sins.STAND_NUMBER,
sins.specific_item,
sins.compared_with_previous,
sins.CREATION_USER,
sins.CREATION_TIME,
sins.VALID_FLAG,
sins.LAST_VERSION_NUMBER,
sins.risk_degree,
sins.compliance_state,
sins.INTERPRETATION_STATE,
sins.STAND_TYPE,
sins.MODIFY_TIME,
sins.STAND_SORT,
sins.STAND_ID,
sins.STAND_NAME,
sins.core_technical_requirement,
ssi.APPLY_ARCTIC as applyArctic,
ssi.COMPLIANCE_REQUIR as compliianceRequir,
ssi.RESPONSIBLE_UNIT as responseibleUnit,
ssi.TERMS_CONDITIONS as termsConditions,
ssi.MAINPOINTS_IMPEMENTATION as mainpointsImpementation,
ssi.SVPPS as svpps,
ssi.FILE_TYPE as fileType,
ssi.XCXSSRQ as xccssrq,
ssi.ZCCSSRQ as zccssrq,
ssi.compliance_state as complianceStateSSI,
ssi.compared_with_previous as compareWithPrevious,
ssi.core_technical_requirement as coreTechnicalRequirementSSI,
ssi.read_content as readContent
FROM
sar_interpretation_national_standard ,(SELECT @i:=0)j
sar_interpretation_national_standard sins
LEFT JOIN sar_stand_items ssi ON ssi.STAND_ID=sins.STAND_ID
and ssi.ITEMS_NUM =sins.specific_item,(SELECT @i:=0)j
WHERE
1=1
<if test="interpretationTime!=null ">
and INTERPRETATION_TIME = #{interpretationTime}
and sins.INTERPRETATION_TIME = #{interpretationTime}
</if>
<if test="standId!=null and standId!=''">
AND STAND_ID = #{standId}
AND sins.STAND_ID = #{standId}
</if>
<if test="standNumber!=null and standNumber!=''">
AND STAND_NUMBER like concat(concat('%',#{standNumber}),'%')
AND sins.STAND_NUMBER like concat(concat('%',#{standNumber}),'%')
</if>
<if test="standName!=null and standName!=''">
AND STAND_NAME like concat(concat('%',#{standName}),'%')
AND sins.STAND_NAME like concat(concat('%',#{standName}),'%')
</if>
<if test="specificItem!=null and specificItem!=''">
AND specific_item like concat(concat('%',#{specificItem}),'%')
AND sins.specific_item like concat(concat('%',#{specificItem}),'%')
</if>
ORDER BY STAND_ID, specific_item
ORDER BY sins.STAND_ID, sins.specific_item
) c ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.specific_item,1,(SELECT LOCATE('.',CONCAT(c.specific_item,'.')))),SIGNED) ,rows
LIMIT ${(current-1)*size},${size}
@@ -5,15 +5,18 @@
<select id="getData" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
wg_committee.committeer , wg_committee_user.committer_id as committorId
wg_committee.committeer , wg_committee_user.committer_id as committorId ,wg_committee.committee_deputy as committeeDeputy,
t3.UNAME as committeeDeputyName
from wg_committee
LEFT JOIN wg_committee_user ON wg_committee.committeer = wg_committee_user.id
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
LEFT JOIN ts_user t3 on t3.USID = wg_committee.committee_deputy
where 1=1
<if test="committeeName != null and ''!=committeeName">
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
</if>
order by create_time desc
limit ${(page-1)*pageSize},${pageSize}
</select>
@@ -31,16 +34,19 @@
<select id="getDataWk" resultType="com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO">
SELECT wg_committee.id, wg_committee.committee_name as committeeName ,wg_committee.committee_director as committeeDirector
,t1.UNAME as committeeDirectorName,wg_committee.committee_secretary as committeeSecretary,t2.UNAME as committeeSecretaryName,
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,
t3.UNAME as committor,t3.USID as committorId,wg_committee.committeer ,wg_committee.committee_deputy as committeeDeputy,
t4.UNAME as committeeDeputyName
from wg_committee
LEFT JOIN ts_user t1 on t1.USID = wg_committee.committee_director
LEFT JOIN ts_user t2 on t2.USID = wg_committee.committee_secretary
LEFT JOIN wg_committee_user on wg_committee_user.id = wg_committee.committeer
LEFT JOIN ts_user t3 on t3.USID = wg_committee_user.committer_id
LEFT JOIN ts_user t4 on t4.USID = wg_committee.committee_deputy
where 1=1
<if test="committeeName != null and ''!=committeeName">
and wg_committee.committee_name like concat(concat('%',#{committeeName}),'%')
</if>
order by create_time desc
limit ${(page-1)*pageSize},${pageSize}
</select>