Commit ceadb056 authored by 韩桐桐's avatar 韩桐桐

feat(jg):移装告知,改造告知,维保合同,维修告知,安装告知,设备移交,启用停用,单位变更,改造变更的列表查询,排除转办查询带来的问题

parent c8dad1ad
......@@ -58,13 +58,12 @@
</foreach>
</if>
<if test="dto.type == 'supervision'">
AND ur.receive_company_code = #{companyCode}
AND (ur.receive_company_code = #{companyCode} or ur.transfer_to_user_ids LIKE concat ('%', #{currentUserId}, '%'))
AND ur.instance_id is not null
</if>
<if test="dto.type == 'company'">
and ur.use_unit_credit_code = #{dto.useUnitCreditCode}
and (ur.use_unit_credit_code = #{dto.useUnitCreditCode} or ur.transfer_to_user_ids LIKE concat ('%', #{currentUserId}, '%'))
</if>
OR (ur.transfer_to_user_ids LIKE concat ('%', #{currentUserId}, '%') AND ur.is_delete = 0)
</where>
order by ur.rec_date desc
</select>
......
......@@ -55,14 +55,11 @@
</foreach>
</if>
<if test="dto.dataType != null and dto.dataType == 'supervision' ">
and ur.receive_org_code = #{dto.receiveOrgCode}
and (ur.receive_org_code = #{dto.receiveOrgCode} or (ur.transfer_to_user_ids like concat('%',#{currentUserId},'%')))
AND ur.instance_id <![CDATA[<>]]> ''
</if>
<if test="dto.dataType != null and dto.dataType == 'company' ">
and ur.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if test="currentUserId != null and currentUserId != '' ">
or(ur.transfer_to_user_ids like concat('%',#{currentUserId},'%') and ur.is_delete = 0)
and (ur.use_unit_credit_code = #{dto.useUnitCreditCode} or (ur.transfer_to_user_ids like concat('%',#{currentUserId},'%')))
</if>
</where>
order by ur.rec_date desc
......
......@@ -48,18 +48,17 @@
</if>
</if>
<if test="type == 'supervision'">
AND isn.receive_org_code = #{orgCode}
AND (isn.receive_org_code = #{orgCode} or isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'enterprise'">
AND isn.new_use_unit_credit_code = #{orgCode}
AND (isn.new_use_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="roleIds != null and type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
</foreach>
</if>
OR (isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) and isn.is_delete = false )
</where>
ORDER BY
isn.create_date DESC, isn.apply_no DESC
......
......@@ -44,10 +44,10 @@
</if>
<if test="type != 'company'">
AND jed.instance_id is not null
and jed.receive_company_code = #{dto.receiveCompanyCode}
and (jed.receive_company_code = #{dto.receiveCompanyCode} or jed.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
<if test="type == 'company'">
and jed.use_unit_credit_code = #{dto.useUnitCreditCode}
and (jed.use_unit_credit_code = #{dto.useUnitCreditCode} or jed.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and jed.receive_org_code = #{dto.receiveOrgCode}
......@@ -55,7 +55,6 @@
<if test="dto.applyType != null and dto.applyType != ''">
and jed.apply_type = #{dto.applyType}
</if>
OR (jed.transfer_to_user_ids like concat('%',#{userId},'%') AND jed.is_delete = 0 )
</where>
order by jed.rec_date desc
</select>
......
......@@ -89,21 +89,23 @@
<when test="param.useUnitCodeFilter != '' and param.useUnitCodeFilter != null and
param.installUnitCodeFilter != '' and param.installUnitCodeFilter != null">
-- 同时有使用单位和施工单位
and (jet.use_unit_credit_code = #{param.useUnitCodeFilter}
or jet.install_unit_credit_code = #{param.installUnitCodeFilter})
and (
jet.use_unit_credit_code = #{param.useUnitCodeFilter}
or jet.install_unit_credit_code = #{param.installUnitCodeFilter}
or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )
)
</when>
<otherwise >
-- 只有使用单位或者施工单位
<if test="param.useUnitCodeFilter != '' and param.useUnitCodeFilter != null">
and jet.use_unit_credit_code = #{param.useUnitCodeFilter}
and (jet.use_unit_credit_code = #{param.useUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="param.installUnitCodeFilter != '' and param.installUnitCodeFilter != null">
and jet.install_unit_credit_code = #{param.installUnitCodeFilter}
and (jet.install_unit_credit_code = #{param.installUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND jet.instance_id <![CDATA[<>]]> ''
</if>
</otherwise>
</choose>
OR (jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) AND jet.is_delete = 0 )
</where>
ORDER BY jet.apply_date DESC
</select>
......
......@@ -56,11 +56,11 @@
</if>
</if>
<if test="type == 'supervision'">
AND isn.receive_org_credit_code = #{orgCode}
AND (isn.receive_org_credit_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND isn.install_unit_credit_code = #{orgCode}
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
</if>
<if test="type == 'testAdmin'">
((AND isn.receive_org_credit_code = #{orgCode}
......@@ -68,7 +68,6 @@
or
AND isn.install_unit_credit_code = #{orgCode})
</if>
or (isn.is_delete = false and isn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
</where>
ORDER BY
isn.create_date DESC
......
......@@ -43,12 +43,11 @@
</if>
<if test="type != 'company'">
AND isn.instance_id <![CDATA[<>]]> ''
AND isn.receive_company_code = #{orgCode}
AND (isn.receive_company_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
<if test="type == 'company'">
AND isn.install_unit_credit_code = #{orgCode}
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
OR (isn.transfer_to_user_ids like concat('%',#{userId},'%') AND isn.is_delete = 0 )
</where>
ORDER BY
isn.apply_no DESC
......
......@@ -158,25 +158,26 @@
<when test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null and
contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
-- 同时有使用单位和维保单位用
and (use_unit_code = #{contractDto.useUnitCodeFilter}
or maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter})
and (
use_unit_code = #{contractDto.useUnitCodeFilter}
or maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}
or transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )
)
</when>
<otherwise >
-- 只有使用单位或者维保单位用,或者都没有
<if test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null">
and use_unit_code = #{contractDto.useUnitCodeFilter}
and (use_unit_code = #{contractDto.useUnitCodeFilter} or transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
and maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}
and (maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter} or transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
</otherwise>
</choose>
-- 监管单位用
<if test="contractDto.receiveOrgCodeFilter != '' and contractDto.receiveOrgCodeFilter != null">
and receive_org_code = #{contractDto.receiveOrgCodeFilter}
and (receive_org_code = #{contractDto.receiveOrgCodeFilter} or transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
-- 转办隔离逻辑
OR (transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) and is_delete = 0)
-- 数据过滤结束 ----------------------------------------------------
</where>
order by apply_no desc
......
......@@ -63,13 +63,12 @@
</if>
<if test="type == 'supervision'">
AND (isn.notice_status in ('6612', '6613', '6614', '6616') )
AND isn.receive_org_code = #{orgCode}
AND (isn.receive_org_code = #{orgCode} or isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND isn.install_unit_credit_code = #{orgCode}
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
OR (isn.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) AND isn.is_delete = 0 )
</where>
ORDER BY
isn.apply_no DESC
......
......@@ -77,11 +77,11 @@
</foreach>
</if>
<if test="type == 'supervision'">
AND tjtn.receive_company_code = #{orgCode}
AND (tjtn.receive_company_code = #{orgCode} or tjtn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
AND tjtn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND tjtn.install_unit_credit_code = #{orgCode}
AND (tjtn.install_unit_credit_code = #{orgCode} or tjtn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
</if>
<if test="type == 'testAdmin'">
((AND tjtn.receive_company_code = #{orgCode}
......@@ -89,7 +89,6 @@
or
AND tjtn.install_unit_credit_code = #{orgCode})
</if>
or (tjtn.is_delete = false and tjtn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%'))
</where>
ORDER BY
tjtn.apply_no DESC
......
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