Commit 6a0ac055 authored by 刘林's avatar 刘林

fix(jg):使用登记添加逻辑删除2

parent d7e2e3a8
......@@ -93,7 +93,7 @@
FROM
tz_cylinder_unit u
WHERE
NOT EXISTS (select 1 from tzs_jg_use_registration r where r.use_unit_credit_code = u.credit_code and r.manage_type='unit' and r.status ='已完成')
NOT EXISTS (select 1 from tzs_jg_use_registration r where r.use_unit_credit_code = u.credit_code and r.manage_type='unit' and r.status ='已完成' and r.is_delete = 0)
and not EXISTS (select 1 from tz_cylinder_question_info q where u.sequence_nbr = q.question_object_id and q.question_type = #{questionType} )
</select>
<insert id="saveOrUpdateBatch" parameterType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit">
......
......@@ -15,6 +15,6 @@ public interface JgRegistrationHistoryMapper extends BaseMapper<JgRegistrationHi
@Select("select sequence_nbr from tzs_jg_registration_history where equ_id = #{equid} and current_document_id = #{documentId}")
Long getSequenceNbrByEquidAndDocumentId(@Param("equid") String equid, @Param("documentId") String documentId);
@Select("select sequence_nbr from tzs_jg_registration_history where registration_class = #{registratioClass} and current_document_id = #{documentId}")
@Select("select sequence_nbr from tzs_jg_registration_history where registration_class = #{registratioClass} and current_document_id = #{documentId} and is_delete = 0")
Long getSequenceNbrByRegistratioClassAndDocumentId(@Param("registratioClass") String registratioClass, @Param("documentId") String documentId);
}
......@@ -148,6 +148,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
......@@ -193,16 +194,6 @@
select
count(1) as inUseNumber
from
tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status <![CDATA[ <> ]]> '6614' and a.apply_status <![CDATA[ <> ]]> '6615' and a.apply_status <![CDATA[ <> ]]> '6610' and a.apply_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
from
tzs_jg_installation_notice a,
tzs_jg_installation_notice_eq b
where
......@@ -285,7 +276,7 @@
<select id="refreshTheDetailsDataOfCompletedUsageRegistration" resultType="java.lang.String">
SELECT sequence_nbr
FROM "amos_tzs_biz"."tzs_jg_use_registration"
WHERE "status" = '已完成'
WHERE "status" = '已完成' and is_delete = 0
AND "audit_pass_date" <![CDATA[<=]]> #{since}
</select>
<select id="selectCityCompanyCode" resultType="string">
......@@ -609,6 +600,7 @@
and n.status != '使用单位待提交'
and n.status != '使用单位已撤回'
and n.status != '已作废'
and n.is_delete = 0
and (n.manage_type is null or n.manage_type = '' or n.manage_type = 'set')
<if test="param.beginDate != null">
and date_ge(CAST(n.reg_date as date), #{param.beginDate})
......@@ -930,7 +922,7 @@
</if>
union all
SELECT SUM(num) FROM (
SELECT count(1) AS num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT count(1) AS num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1041,7 +1033,7 @@
union all
SELECT SUM(num) FROM (
SELECT count(1) as num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT count(1) as num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1221,7 +1213,7 @@
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1252,7 +1244,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1537,7 +1529,7 @@
</select>
<select id="countBizFinishedNumForDPSYDJ" resultType="java.lang.Long">
SELECT SUM(num) FROM (
SELECT count(1) AS num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT count(1) AS num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1653,7 +1645,7 @@
</select>
<select id="countAllInFlowingForDPNoFinishedBizDataSYDJ" resultType="java.lang.Long">
SELECT SUM(num) FROM (
SELECT count(1) as num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT count(1) as num FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1836,7 +1828,7 @@
</select>
<select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map">
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1867,7 +1859,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2178,8 +2170,8 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.status <![CDATA[ <> ]]> '已作废')
and a.is_delete = false
UNION
select
count(1) as inUseNumber
......@@ -2224,16 +2216,6 @@
select
count(1) as inUseNumber
from
tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
from
tzs_jg_installation_notice a,
tzs_jg_installation_notice_eq b
where
......
......@@ -224,6 +224,7 @@
AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车')
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
and tjur.reg_type is null
and tjur.is_delete = 0
GROUP BY SUBSTR(t.use_registration_code, 1, 5)
HAVING code <![CDATA[ <> ]]> '00000'
ORDER BY prefix
......
......@@ -377,6 +377,7 @@
LEFT JOIN "tzs_jg_use_registration" AS tjur ON tjure."equip_transfer_id" = tjur."sequence_nbr"
WHERE tjure."equ_id" = #{id}
AND tjur."status" = '已完成'
AND tjure.is_delete = 0
ORDER BY tjure."rec_date" desc
LIMIT 1
</select>
......@@ -509,7 +510,7 @@
<if test="jsonObject.record == null">
and not exists(SELECT 1 FROM tzs_jg_use_registration v, tzs_jg_use_registration_eq ve WHERE
v.sequence_nbr = ve.equip_transfer_id AND ve.equ_id = ui."RECORD" and v.status !='使用单位待提交' and v.status
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' )
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' and v.is_delete = 0)
</if>
ORDER BY ui.REC_DATE DESC
) where uscUnitName is not null
......@@ -742,7 +743,6 @@
AND A.sequence_nbr = ae.equip_transfer_id
AND u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{dpFilterParamDto.beginDate} and #{dpFilterParamDto.endDate})
AND A.status = '已完成'
AND A.is_delete = 0
) C
......
......@@ -151,7 +151,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
List<JgEquipTransferEq> jgEquipTransferEqList = this.buildJgEquipTransferEqList(equipTransferEqList, transferList);
jgEquipTransferEqMapper.insertBatchSomeColumn(jgEquipTransferEqList);
//this.updateRedisBatch(transferList);
this.updateRedisBatch(transferList);
// 创建历史数据
this.saveOrUpdateHisDataBatch(jgEquipTransferEqList);
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
......
......@@ -323,7 +323,7 @@
FROM
tzs_jg_use_registration T
WHERE
T.status = '已完成'
T.status = '已完成' and T.is_delete = 0
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</select>
<select id="over15yearsCount" resultType="java.lang.Long">
......@@ -337,6 +337,8 @@
thur.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
AND thur.audit_pass_date &lt; #{time}
AND ibjri."EQU_LIST" = '3000'
AND ibjri.is_delete = 0
AND thur.is_delete = 0
</select>
<select id="constructionNoticeCount" resultType="java.lang.Long">
SELECT SUM
......@@ -666,7 +668,7 @@
FROM
tzs_jg_use_registration T
WHERE
T.audit_status = '已完成'
T.audit_status = '已完成' and T.is_delete = 0
and T.receive_company_org_code like concat(#{orgCode}, '%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.reg_date as date),#{dto.beginDate})
......@@ -1138,7 +1140,7 @@
LEFT JOIN idx_biz_jg_register_info ri ON tne.equ_id = ri.RECORD
WHERE
receive_company_org_code like CONCAT(#{orgCode}, '%')
and tjur.status != '已作废'
and tjur.status != '已作废' and tjur.is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1850,7 +1852,7 @@
LEFT JOIN idx_biz_jg_register_info ri ON tne.equ_id = ri.RECORD
WHERE
receive_company_org_code like CONCAT(#{orgCode}, '%')
and tjur.status != '已作废'
and tjur.status != '已作废' and tjur.is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment