Browse Source

bugfix:营业员列表创建时间倒叙排

bing 6 days ago
parent
commit
68238dd797

+ 2 - 1
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/service/impl/PtAccountServiceImpl.java

@@ -62,6 +62,7 @@ public class PtAccountServiceImpl implements IPtAccountService {
62 62
     @Override
63 63
     public TableDataInfo<PtAccountVo> queryPageList(PtAccountBo bo, PageQuery pageQuery) {
64 64
         LambdaQueryWrapper<PtAccount> lqw = buildQueryWrapper(bo);
65
+        lqw.orderByDesc(PtAccount::getCreateTime);
65 66
         Page<PtAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
66 67
         return TableDataInfo.build(result);
67 68
     }
@@ -175,7 +176,7 @@ public class PtAccountServiceImpl implements IPtAccountService {
175 176
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
176 177
         if(isValid){
177 178
             if(ptOperatorMapper.selectCount(Wrappers.<PtOperator>lambdaQuery().in(PtOperator::getAccountId, ids)) > 0){
178
-                throw new ServiceException("已有营业员绑定此账号,不能删除");
179
+                throw new ServiceException("已有营业员绑定此账号,请删除营业员数据后再删除!");
179 180
             }
180 181
         }
181 182
         return baseMapper.deleteByIds(ids) > 0;

+ 1 - 1
ruoyi-modules/ruoyi-backstage/src/main/resources/mapper/merchant/PtOperatorMapper.xml

@@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
59 59
             <if test="bo.lifespan != null">
60 60
                 and to_char(o.lifespan,'%Y-%m-%d') &lt;= #{bo.lifespan}
61 61
             </if>
62
-
63 62
         </where>
63
+        order by o.create_time desc
64 64
     </select>
65 65
 </mapper>