|
|
|
@ -128,14 +128,102 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg |
|
|
|
private LambdaQueryWrapper<NonEnforcementRegistration> buildQueryWrapper(NonEnforcementRegistrationBo bo) { |
|
|
|
LambdaQueryWrapper<NonEnforcementRegistration> lqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
// 根据实际业务需要添加查询条件
|
|
|
|
// 根据XML文件中的查询条件添加查询条件
|
|
|
|
if (bo != null) { |
|
|
|
// 企业名称 - 模糊查询
|
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), NonEnforcementRegistration::getEnterpriseName, bo.getEnterpriseName()); |
|
|
|
// 企业编号 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseNumber()), NonEnforcementRegistration::getEnterpriseNumber, bo.getEnterpriseNumber()); |
|
|
|
// 执法时间 - 精确查询
|
|
|
|
lqw.eq(bo.getEnforcementTime() != null, NonEnforcementRegistration::getEnforcementTime, bo.getEnforcementTime()); |
|
|
|
// 执法人员姓名 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcer()), NonEnforcementRegistration::getLawEnforcer, bo.getLawEnforcer()); |
|
|
|
// 执法人员ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerId()), NonEnforcementRegistration::getLawEnforcerId, bo.getLawEnforcerId()); |
|
|
|
// 其他执法人员姓名 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerOther()), NonEnforcementRegistration::getLawEnforcerOther, bo.getLawEnforcerOther()); |
|
|
|
// 其他执法人员ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerIdOther()), NonEnforcementRegistration::getLawEnforcerIdOther, bo.getLawEnforcerIdOther()); |
|
|
|
// 执法类别 - 精确查询
|
|
|
|
lqw.eq(bo.getLawEnforcementType() != null, NonEnforcementRegistration::getLawEnforcementType, bo.getLawEnforcementType()); |
|
|
|
// 执法类别文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementTypeText()), NonEnforcementRegistration::getLawEnforcementTypeText, bo.getLawEnforcementTypeText()); |
|
|
|
// 执法事项 - 精确查询
|
|
|
|
lqw.eq(bo.getLawEnforcementItem() != null, NonEnforcementRegistration::getLawEnforcementItem, bo.getLawEnforcementItem()); |
|
|
|
// 执法事项文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementItemText()), NonEnforcementRegistration::getLawEnforcementItemText, bo.getLawEnforcementItemText()); |
|
|
|
// 执法依据 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementBasis()), NonEnforcementRegistration::getLawEnforcementBasis, bo.getLawEnforcementBasis()); |
|
|
|
// 执法依据文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementBasisText()), NonEnforcementRegistration::getLawEnforcementBasisText, bo.getLawEnforcementBasisText()); |
|
|
|
// 执法结果 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getReslut() != null, NonEnforcementRegistration::getReslut, bo.getReslut()); |
|
|
|
// 状态 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getStatus() != null, NonEnforcementRegistration::getStatus, bo.getStatus()); |
|
|
|
// 是否删除 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasDelete() != null, NonEnforcementRegistration::getHasDelete, bo.getHasDelete()); |
|
|
|
// 是否投诉 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasComplaint() != null, NonEnforcementRegistration::getHasComplaint, bo.getHasComplaint()); |
|
|
|
// 是否提交 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasSubmit() != null, NonEnforcementRegistration::getHasSubmit, bo.getHasSubmit()); |
|
|
|
// 是否评价 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasEvaluate() != null, NonEnforcementRegistration::getHasEvaluate, bo.getHasEvaluate()); |
|
|
|
// 预告ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawId()), NonEnforcementRegistration::getLawId, bo.getLawId()); |
|
|
|
// 预告文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawText()), NonEnforcementRegistration::getLawText, bo.getLawText()); |
|
|
|
// 执法主体部门ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getBureauDeptId()), NonEnforcementRegistration::getBureauDeptId, bo.getBureauDeptId()); |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerId()), NonEnforcementRegistration::getLawEnforcerId, bo.getLawEnforcerId()); |
|
|
|
// 执法主体部门名称 - 模糊查询
|
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getBureauDeptName()), NonEnforcementRegistration::getBureauDeptName, bo.getBureauDeptName()); |
|
|
|
// 统一信用代码 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCreditcode()), NonEnforcementRegistration::getCreditcode, bo.getCreditcode()); |
|
|
|
// 用户ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), NonEnforcementRegistration::getUserId, bo.getUserId()); |
|
|
|
// 部门ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), NonEnforcementRegistration::getDeptId, bo.getDeptId()); |
|
|
|
|
|
|
|
// searchValue - 多字段模糊查询
|
|
|
|
if (StringUtils.isNotBlank(bo.getSearchValue())) { |
|
|
|
lqw.and(wrapper -> wrapper |
|
|
|
.like(NonEnforcementRegistration::getLawEnforcementItemText, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getBureauDeptName, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getLawEnforcer, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getLawEnforcerOther, bo.getSearchValue()) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// dateType - 时间范围查询
|
|
|
|
if (bo.getDateType() != null) { |
|
|
|
if (bo.getDateType() == 1) { |
|
|
|
// 本月
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')"); |
|
|
|
} else if (bo.getDateType() == 2) { |
|
|
|
// 本季度
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', " + |
|
|
|
"CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (2) THEN '04' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (3) THEN '07' " + |
|
|
|
"ELSE '10' END) " + |
|
|
|
"and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', " + |
|
|
|
"CASE " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (1) THEN '03' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (2) THEN '06' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (3) THEN '09' " + |
|
|
|
"ELSE '12' " + |
|
|
|
"END)"); |
|
|
|
} else if (bo.getDateType() == 3) { |
|
|
|
// 本年
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// dateSearch - 时间范围查询
|
|
|
|
if (StringUtils.isNotBlank(bo.getDateSearch())) { |
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') = {0}", bo.getDateSearch()); |
|
|
|
} |
|
|
|
|
|
|
|
// 按执法时间倒序排序
|
|
|
|
lqw.orderByDesc(NonEnforcementRegistration::getEnforcementTime); |
|
|
|
} |
|
|
|
|
|
|
|
|