优化查询条件

master
bynt 1 year ago
parent c1ad05aac7
commit 42096275a6

@ -42,11 +42,16 @@ public class CustomController {
(SecurityUtils.getCurrentUserId()))) { (SecurityUtils.getCurrentUserId()))) {
qo.setCompanyId(SecurityUtils.getWhichUserId()); qo.setCompanyId(SecurityUtils.getWhichUserId());
} }
if (ObjectUtil.isNotNull(qo.getSalesmanType()) && qo.getSalesmanType() == 1) { if (ObjectUtil.isNotNull(qo.getSalesmanType())) {
if (qo.getSalesmanType() == 1) {
// 查询当前用户自己的 // 查询当前用户自己的
qo.setSalesmanType(null); qo.setSalesmanType(null);
qo.setCreateBy(SecurityUtils.getCurrentUserId()); qo.setCreateBy(SecurityUtils.getCurrentUserId());
} }
if (qo.getSalesmanType() > 1) {
qo.setEnrollStatus(0);
}
}
return R.ok(customService.queryPage(pageParam, qo)); return R.ok(customService.queryPage(pageParam, qo));
} }

@ -22,6 +22,7 @@ public interface CustomMapper extends ExtendMapper<CustomEntity> {
wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy()) wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy())
.likeIfPresent(CustomEntity::getCustomName, qo.getCustomName()) .likeIfPresent(CustomEntity::getCustomName, qo.getCustomName())
.likeIfPresent(CustomEntity::getBatchNo, qo.getBatchNo()) .likeIfPresent(CustomEntity::getBatchNo, qo.getBatchNo())
.gtIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus())
.eqIfPresent(CustomEntity::getCompanyId, qo.getCompanyId()) .eqIfPresent(CustomEntity::getCompanyId, qo.getCompanyId())
.eqIfPresent(CustomEntity::getType, qo.getSalesmanType()) .eqIfPresent(CustomEntity::getType, qo.getSalesmanType())
.eqIfPresent(CustomEntity::getCustomNid, qo.getCustomNid()) .eqIfPresent(CustomEntity::getCustomNid, qo.getCustomNid())

Loading…
Cancel
Save