隐患排查加计划id筛选条件

This commit is contained in:
2026-06-01 16:39:02 +08:00
parent afaa25489d
commit 71558b072d
5 changed files with 12 additions and 3 deletions

View File

@@ -135,7 +135,8 @@ public class HotHiddenDangerInspectionController extends BaseController {
) )
public TableDataInfo<HotHiddenDangerInspectionVo> hiddenDangerPlanPage( public TableDataInfo<HotHiddenDangerInspectionVo> hiddenDangerPlanPage(
@RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "planId", required = false) Long planId,
PageQuery pageQuery) { PageQuery pageQuery) {
return hotHiddenDangerInspectionService.queryMobilePlanPage(keyword, pageQuery); return hotHiddenDangerInspectionService.queryMobilePlanPage(keyword, planId, pageQuery);
} }
} }

View File

@@ -23,6 +23,7 @@ public interface HotHiddenDangerInspectionMapper extends BaseMapperPlus<HotHidde
@Param("isAdmin") Boolean isAdmin, @Param("isAdmin") Boolean isAdmin,
@Param("driverId") String driverId, @Param("driverId") String driverId,
@Param("vehicleId") String vehicleId, @Param("vehicleId") String vehicleId,
@Param("planId") Long planId,
@Param("keyword") String keyword, @Param("keyword") String keyword,
@Param("currentMonth") String currentMonth); @Param("currentMonth") String currentMonth);
} }

View File

@@ -33,7 +33,7 @@ public interface IHotHiddenDangerInspectionService {
*/ */
TableDataInfo<HotHiddenDangerInspectionVo> queryPageList(HotHiddenDangerInspectionBo bo, PageQuery pageQuery); TableDataInfo<HotHiddenDangerInspectionVo> queryPageList(HotHiddenDangerInspectionBo bo, PageQuery pageQuery);
TableDataInfo<HotHiddenDangerInspectionVo> queryMobilePlanPage(String keyword, PageQuery pageQuery); TableDataInfo<HotHiddenDangerInspectionVo> queryMobilePlanPage(String keyword, Long planId, PageQuery pageQuery);
/** /**
* 查询符合条件的隐患排查-排查项目列表 * 查询符合条件的隐患排查-排查项目列表

View File

@@ -88,7 +88,7 @@ public class HotHiddenDangerInspectionServiceImpl implements IHotHiddenDangerIns
} }
@Override @Override
public TableDataInfo<HotHiddenDangerInspectionVo> queryMobilePlanPage(String keyword, PageQuery pageQuery) { public TableDataInfo<HotHiddenDangerInspectionVo> queryMobilePlanPage(String keyword, Long planId, PageQuery pageQuery) {
Long companyId = LoginHelper.getCompanyId(); Long companyId = LoginHelper.getCompanyId();
if (companyId == null) { if (companyId == null) {
throw new ServiceException("当前登录用户无公司信息"); throw new ServiceException("当前登录用户无公司信息");
@@ -109,6 +109,7 @@ public class HotHiddenDangerInspectionServiceImpl implements IHotHiddenDangerIns
!isDriver, !isDriver,
driverId, driverId,
vehicleId, vehicleId,
planId,
StringUtils.trimToNull(keyword), StringUtils.trimToNull(keyword),
currentMonth currentMonth
); );

View File

@@ -28,6 +28,9 @@
WHERE i.is_deleted = 0 WHERE i.is_deleted = 0
AND i.company_id = #{companyId} AND i.company_id = #{companyId}
AND DATE_FORMAT(COALESCE(p.start_date, i.create_time), '%Y-%m') = #{currentMonth} AND DATE_FORMAT(COALESCE(p.start_date, i.create_time), '%Y-%m') = #{currentMonth}
<if test="planId != null">
AND i.plan_id = #{planId}
</if>
<if test="isAdmin == false"> <if test="isAdmin == false">
AND ( AND (
(i.project_type = 3 AND i.project_id = #{driverId}) (i.project_type = 3 AND i.project_id = #{driverId})
@@ -57,6 +60,9 @@
AND i.company_id = #{companyId} AND i.company_id = #{companyId}
AND DATE_FORMAT(COALESCE(p.start_date, i.create_time), '%Y-%m') != #{currentMonth} AND DATE_FORMAT(COALESCE(p.start_date, i.create_time), '%Y-%m') != #{currentMonth}
AND (i.status IS NULL OR i.status = 1 OR i.status = 2) AND (i.status IS NULL OR i.status = 1 OR i.status = 2)
<if test="planId != null">
AND i.plan_id = #{planId}
</if>
<if test="isAdmin == false"> <if test="isAdmin == false">
AND ( AND (
(i.project_type = 3 AND i.project_id = #{driverId}) (i.project_type = 3 AND i.project_id = #{driverId})