|
|
@@ -9,7 +9,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.backstage.cardCenter.service.IPtCardService;
|
|
|
import org.dromara.backstage.payment.domain.vo.PtUserAccount4SelectVo;
|
|
|
import org.dromara.backstage.payment.service.IPtBagService;
|
|
|
-import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.core.utils.file.FileUtils;
|
|
|
@@ -88,7 +87,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
@Override
|
|
|
public TableDataInfo<PtUserAccount4SelectVo> queryPageList4Select(PtUserAccountBo bo, PageQuery pageQuery) {
|
|
|
// 方法1. 使用子查询,使得where 后 只有一个表(效率会低点) 方法2. 使用queryWrapper 自己指定字段,字段名带表别名
|
|
|
- QueryWrapper<PtUserAccount> wrapper = buildQueryWrapper(bo, "u");
|
|
|
+ QueryWrapper<PtUserAccount> wrapper = buildQueryWrapper4Select(bo, "u");
|
|
|
+ if(bo.getDeptId() != null){
|
|
|
+ wrapper.and(wrapper1 -> wrapper1.eq("u.dept_id", bo.getDeptId()).or().like("a.ancestors", bo.getDeptId()));
|
|
|
+ }
|
|
|
wrapper.orderByAsc("u.dept_id").orderByAsc("u.user_id");
|
|
|
Page<PtUserAccount4SelectVo> result = baseMapper.customPageList(pageQuery.build(), wrapper);
|
|
|
return TableDataInfo.build(result);
|
|
|
@@ -142,14 +144,20 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
return lqw;
|
|
|
}
|
|
|
|
|
|
- private QueryWrapper<PtUserAccount> buildQueryWrapper(PtUserAccountBo bo,String tableAlias) {
|
|
|
+ /**
|
|
|
+ * 给一卡通账户列表查询条件使用
|
|
|
+ * @param bo
|
|
|
+ * @param tableAlias
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private QueryWrapper<PtUserAccount> buildQueryWrapper4Select(PtUserAccountBo bo, String tableAlias) {
|
|
|
QueryWrapper<PtUserAccount> wrapper = new QueryWrapper<>();
|
|
|
String columnPrefix = "";
|
|
|
if(StringUtils.isNotBlank(tableAlias)){
|
|
|
columnPrefix = tableAlias + ".";
|
|
|
}
|
|
|
wrapper.eq(bo.getPostId() != null, columnPrefix+"post_id", bo.getPostId());
|
|
|
- wrapper.eq(bo.getDeptId() != null, columnPrefix+"dept_id", bo.getDeptId());
|
|
|
+// wrapper.like(bo.getDeptId() != null, columnPrefix+"dept_id", bo.getDeptId());
|
|
|
wrapper.eq(StringUtils.isNotBlank(bo.getUserNumb()), columnPrefix+"user_numb", bo.getUserNumb());
|
|
|
wrapper.like(StringUtils.isNotBlank(bo.getRealName()), columnPrefix+"real_name", bo.getRealName());
|
|
|
wrapper.eq(StringUtils.isNotBlank(bo.getAccountStatus()), columnPrefix+"account_status", bo.getAccountStatus());
|