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

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

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