数据所属组织修改

This commit is contained in:
bonus 2026-01-16 18:03:54 +08:00
parent e4789dd930
commit 0231533530
6 changed files with 35 additions and 38 deletions

View File

@ -85,8 +85,8 @@ public class LeaseTaskController extends BaseController {
@ApiOperation(value = "领用记录列表查询") @ApiOperation(value = "领用记录列表查询")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(LeaseApplyInfo leaseApplyInfo) { public AjaxResult list(LeaseApplyInfo leaseApplyInfo) {
Long deptId = typeService.getUserDeptId(); // Long deptId = typeService.getUserDeptId();
leaseApplyInfo.setCompanyId(deptId); // leaseApplyInfo.setCompanyId(deptId);
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
try { try {
@ -371,8 +371,8 @@ public class LeaseTaskController extends BaseController {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
try { try {
Long deptId = typeService.getUserDeptId(); // Long deptId = typeService.getUserDeptId();
leaseApplyInfo.setCompanyId(deptId); // leaseApplyInfo.setCompanyId(deptId);
List<LeaseApplyInfo> list = service.selectAuditLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = service.selectAuditLeaseApplyInfoList(leaseApplyInfo);
if (leaseApplyInfo.getIsApp()==null){ if (leaseApplyInfo.getIsApp()==null){
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));

View File

@ -41,14 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) a ON pcd.task_id = a.task_id AND pcd.type_id = a.type_id ) a ON pcd.task_id = a.task_id AND pcd.type_id = a.type_id
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
WHERE WHERE
tt.task_type = 0 tt.task_type = 0
<if test="userId != null ">
and mtm.user_id = #{userId}
</if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
and pcd.company_id=#{companyId} and mt1.company_id=#{companyId}
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (

View File

@ -456,7 +456,7 @@
AND sai.end_time IS NULL AND sai.end_time IS NULL
AND sai.back_id IS NULL AND sai.back_id IS NULL
<if test="companyId !=null"> <if test="companyId !=null">
AND sai.company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY mt.type_id GROUP BY mt.type_id
) AS subquery1 ) AS subquery1
@ -483,7 +483,7 @@
tt.task_status IN (0, 4) tt.task_status IN (0, 4)
and tt.code is not null and tt.code is not null
<if test="companyId !=null"> <if test="companyId !=null">
AND rad.company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY GROUP BY
mt.type_id) AS subquery2 ON subquery2.type_id = mt.type_id mt.type_id) AS subquery2 ON subquery2.type_id = mt.type_id
@ -508,7 +508,7 @@
tt.code is not null tt.code is not null
and rad.`status` = '0' and rad.`status` = '0'
<if test="companyId !=null"> <if test="companyId !=null">
AND rad.company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY GROUP BY
mt.type_id) AS subquery12 ON subquery12.type_id = mt.type_id mt.type_id) AS subquery12 ON subquery12.type_id = mt.type_id
@ -533,7 +533,7 @@
WHERE IFNULL(rid.repair_num, 0) - IFNULL(rid.input_num, 0) - IFNULL(rid.reject_num, 0) > 0 WHERE IFNULL(rid.repair_num, 0) - IFNULL(rid.input_num, 0) - IFNULL(rid.reject_num, 0) > 0
and tt.task_status = 0 and tt.task_status = 0
<if test="companyId !=null"> <if test="companyId !=null">
AND rid.company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY GROUP BY
mt.type_id) AS subquery3 ON subquery3.type_id = mt.type_id mt.type_id) AS subquery3 ON subquery3.type_id = mt.type_id
@ -557,7 +557,7 @@
WHERE IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0) > 0 WHERE IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0) > 0
and pcd.status in (3,4, 13,14) and pcd.status in (3,4, 13,14)
<if test="companyId !=null"> <if test="companyId !=null">
AND pcd.company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY GROUP BY
mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id
@ -1060,30 +1060,31 @@
FROM FROM
( (
SELECT SELECT
type_id, sa.type_id,
ma_id, sa.ma_id,
lease_id, sa.lease_id,
agreement_id, sa. agreement_id,
SUM( num ) AS usNum SUM( sa.num ) AS usNum
FROM FROM
slt_agreement_info slt_agreement_info sa
LEFT JOIN ma_type mt ON mt.type_id = sa.type_id
WHERE WHERE
`status` = '0' sa.`status` = '0'
AND end_time IS NULL AND sa.end_time IS NULL
AND back_id IS NULL AND sa.back_id IS NULL
AND `is_slt` = '0' and source =1 AND sa.`is_slt` = '0' and sa.source =1
<if test="typeId != null"> <if test="typeId != null">
AND type_id = #{typeId} AND sa.type_id = #{typeId}
</if> </if>
<if test="companyId !=null"> <if test="companyId !=null">
AND company_id = #{companyId} AND mt.company_id = #{companyId}
</if> </if>
GROUP BY GROUP BY
type_id, sa.type_id,
ma_id, sa.ma_id,
lease_id, sa.lease_id,
agreement_id sa.agreement_id
) AS sai_agg ) AS sai_agg
LEFT JOIN ma_type mt ON mt.type_id = sai_agg.type_id LEFT JOIN ma_type mt ON mt.type_id = sai_agg.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
@ -1760,9 +1761,7 @@
<foreach item="item" collection="list" index="index" separator="," close=")" open="("> <foreach item="item" collection="list" index="index" separator="," close=")" open="(">
#{item} #{item}
</foreach> </foreach>
<if test="companyId != null">
and lod.company_id= #{companyId}
</if>
GROUP BY lod.parent_id GROUP BY lod.parent_id
</select> </select>

View File

@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bu.type_id = #{typeId} AND bu.type_id = #{typeId}
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
AND bu.dept_id = #{companyId} AND bu.company_id = #{companyId}
</if> </if>
@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bu.type_id = #{typeId} AND bu.type_id = #{typeId}
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
AND bu.dept_id = #{companyId} AND bu.company_id = #{companyId}
</if> </if>
UNION UNION
@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bu.type_id = #{typeId} AND bu.type_id = #{typeId}
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
AND bu.dept_id = #{companyId} AND bu.company_id = #{companyId}
</if> </if>
) ff ) ff
ORDER BY ORDER BY

View File

@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND mt.jiju_type = #{jiJuTypeStr} AND mt.jiju_type = #{jiJuTypeStr}
</if> </if>
<if test="companyId != null "> <if test="companyId != null ">
and ma.company_id = #{companyId} and mt.company_id = #{companyId}
</if> </if>
) a ) a
where where

View File

@ -251,7 +251,7 @@
and sai.`status`='0' and sai.`status`='0'
AND mt2.type_id not in (6032,6008,6270) AND mt2.type_id not in (6032,6008,6270)
<if test="companyId != null"> <if test="companyId != null">
AND sd.dept_id=#{companyId} AND mt.company_id=#{companyId}
</if> </if>
/*AND DATEDIFF(mm.next_check_time, CURDATE()) &lt;= 30*/ /*AND DATEDIFF(mm.next_check_time, CURDATE()) &lt;= 30*/
<if test="status != null and status == 0"> <if test="status != null and status == 0">