Quellcode durchsuchen

1.修复经纬度错乱问题;
2.新增骑手查看可接订单(新)接口;
3.骑手查看可接订单(按商家分组)接口;

codingliang vor 2 Jahren
Ursprung
Commit
1cc66e3f7b

+ 20 - 2
src/main/java/com/sqx/modules/errand/controller/app/AppTbIndentController.java

@@ -1,6 +1,7 @@
 package com.sqx.modules.errand.controller.app;
 
 import com.sqx.common.utils.DateUtils;
+import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.app.entity.UserEntity;
@@ -8,6 +9,7 @@ import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.errand.dto.RiderDeliveryDTO;
+import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.*;
 import com.sqx.modules.errand.service.ErrandComplaintService;
 import com.sqx.modules.errand.service.TbIndentService;
@@ -164,8 +166,8 @@ public class AppTbIndentController {
     @ApiOperation("骑手查看可接订单")
     public Result findNewIndent(@RequestAttribute Long userId, @RequestBody TbIndent tbIndent){
         String receivingPettern = tbIndent.getReceivingPettern();
-        double riderlat = tbIndent.getRiderlng();
-        double riderlng = tbIndent.getRiderlat();
+        double riderlat = tbIndent.getRiderlat();
+        double riderlng = tbIndent.getRiderlng();
         Integer page = tbIndent.getPage();
         Integer limit = tbIndent.getLimit();
         String indentType = tbIndent.getIndentType();
@@ -174,6 +176,22 @@ public class AppTbIndentController {
     }
 
     @Login
+    @PostMapping(value = "find-new-indent")
+    @ApiOperation("骑手查看可接订单(新)")
+    public Result findNewIndent(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO){
+        PageUtils newIndent = tbIndentService.findNewIndent(queryDTO);
+        return Result.success().put("data", newIndent);
+    }
+
+    @Login
+    @PostMapping(value = "find-new-indent-group-by-shop")
+    @ApiOperation("骑手查看可接订单(按商家分组)")
+    public Result findNewIndentGroupByShop(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO){
+        PageUtils newIndent = tbIndentService.findNewIndentGroupByShop(queryDTO);
+        return Result.success().put("data", newIndent);
+    }
+
+    @Login
     @PostMapping(value = "indentReceiving")
     @ApiOperation("骑手接单")
     public Result indentReceiving(@RequestAttribute Long userId, String indentNumber){

+ 9 - 1
src/main/java/com/sqx/modules/errand/dao/TbIndentDao.java

@@ -3,11 +3,12 @@ package com.sqx.modules.errand.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.sqx.modules.address.entity.Address;
 import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
 import com.sqx.modules.errand.entity.TbIndent;
+import com.sqx.modules.errand.vo.ShopWaitAcceptOrderVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,6 +23,12 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
     IPage<TbIndent> findNewIndentcity(Page<TbIndent> pages, double riderLng, double riderLat, String address, String indentType);
 
+    IPage<TbIndent> findNewIndentByCity(@Param("pages") Page<TbIndent> pages, @Param("queryDTO") WaitForAcceptOrderQueryDTO queryDTO);
+
+    IPage<TbIndent> findNewIndentByDistances(@Param("pages") Page<TbIndent> pages, @Param("queryDTO") WaitForAcceptOrderQueryDTO queryDTO);
+
+    IPage<ShopWaitAcceptOrderVO> findNewIndentByDistancesGroupByShop(@Param("pages") Page<ShopWaitAcceptOrderVO> pages, @Param("queryDTO") WaitForAcceptOrderQueryDTO queryDTO);
+
     TbIndent findIndentByNumber(String indentNumber);
 
     int selectIndentByRiderUserCount(Long riderUserId);
@@ -140,4 +147,5 @@ public interface TbIndentDao extends BaseMapper<TbIndent> {
 
     TbIndent indentMessageByOrderId(Long orderId, double riderLng, double riderLat);
 
+    IPage<ShopWaitAcceptOrderVO> findNewIndentByCityGroupByShop(@Param("pages") Page<ShopWaitAcceptOrderVO> pages, @Param("queryDTO") WaitForAcceptOrderQueryDTO queryDTO);
 }

+ 45 - 0
src/main/java/com/sqx/modules/errand/dto/WaitForAcceptOrderQueryDTO.java

@@ -0,0 +1,45 @@
+package com.sqx.modules.errand.dto;
+
+import com.sqx.common.query.PageQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+/**
+ * 等待接单查询dto
+ */
+@Data
+public class WaitForAcceptOrderQueryDTO extends PageQuery {
+    @ApiModelProperty("接单模式 1近单模式,2同城模式")
+    @NotBlank(message = "接单模式不能为空")
+    @Pattern(regexp = "(1|2)", message = "接单模式只能为1或2")
+    private String receivingPattern;
+
+    @ApiModelProperty("骑手位置经度 xxx.yyyy")
+    @NotNull(message = "骑手位置经度不能为空")
+    private Double riderLng;
+
+    @ApiModelProperty("骑手位置纬度 xx.yyyy")
+    @NotNull(message = "骑手位置纬度不能为空")
+    private Double riderLat;
+
+    @ApiModelProperty("订单类型 1:帮我送;2:帮我取;3:同城帮买;4:同城服务;5:外卖配送;不传查所有类型")
+    @Pattern(regexp = "[1-5]", message = "订单类型只能为1-5")
+    private String indentType;
+
+    @ApiModelProperty("购买类型 0:骑手就近购买;1:用户指定地址购买")
+    @Pattern(regexp = "(0|1)", message = "购买类型只能为1或0")
+    private String buyType;
+
+    @ApiModelProperty("店铺id")
+    private Long shopId;
+
+    @ApiModelProperty(value = "接单距离", hidden = true)
+    private Double distances;
+
+    @ApiModelProperty(value = "接单城市", hidden = true)
+    private String city;
+}

+ 6 - 1
src/main/java/com/sqx/modules/errand/service/TbIndentService.java

@@ -1,9 +1,11 @@
 package com.sqx.modules.errand.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.errand.dto.RiderDeliveryDTO;
+import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandEvaluate;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
@@ -22,6 +24,10 @@ public interface TbIndentService extends IService<TbIndent> {
 
     Result findNewIndent(Long userId, String receivingPettern, Integer page, Integer limit, double riderLng, double riderLat, String indentType, String buyType);
 
+    PageUtils findNewIndent(WaitForAcceptOrderQueryDTO queryDTO);
+
+    PageUtils findNewIndentGroupByShop(WaitForAcceptOrderQueryDTO queryDTO);
+
     Result indentReceiving(Long userId, String indentNumber);
 
     Result riderBuyGoods(TbIndent tbIndent);
@@ -99,5 +105,4 @@ public interface TbIndentService extends IService<TbIndent> {
     Result userCancleIndent(Long userId, String indentNumber);
 
     TbIndent indentMessageByOrderId(Long orderId, double ol, double od);
-
 }

+ 102 - 42
src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java

@@ -25,6 +25,7 @@ import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.errand.dao.ErrandEvaluateDao;
 import com.sqx.modules.errand.dao.TbIndentDao;
 import com.sqx.modules.errand.dto.RiderDeliveryDTO;
+import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
 import com.sqx.modules.errand.entity.ErrandAddress;
 import com.sqx.modules.errand.entity.ErrandEvaluate;
 import com.sqx.modules.errand.entity.ErrandRedPacket;
@@ -33,6 +34,7 @@ import com.sqx.modules.errand.service.TbIndentService;
 import com.sqx.modules.errand.service.TbIndentSmsSendLogService;
 import com.sqx.modules.errand.service.TbIndentSmsTemplateService;
 import com.sqx.modules.errand.util.LonLatUtil;
+import com.sqx.modules.errand.vo.ShopWaitAcceptOrderVO;
 import com.sqx.modules.goods.dao.GoodsShopDao;
 import com.sqx.modules.goods.dao.GoodsShopRelevancyDao;
 import com.sqx.modules.goods.entity.GoodsShop;
@@ -191,7 +193,36 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
 
     }
 
+    @Override
+    public Result findNewIndent(Long userId, String receivingPettern, Integer page, Integer limit, double riderLng, double riderLat, String indentType, String buyType) {
+        Page<TbIndent> pages=new Page<>(page,limit);
+        IPage<TbIndent> indent = null;
+        if(receivingPettern.equals("1")){
+            CommonInfo one = commonInfoService.findOne(274);
+            Integer value =Integer.valueOf(one.getValue());
+            double distances = value;
+            indent = baseMapper.findNewIndent(pages, riderLng, riderLat, distances, indentType);
+            for (int i = 0;i<indent.getRecords().size();i++){
+                if("4".equals(indent.getRecords().get(i).getIndentType())){
+                    Result distance = distance(riderLng, riderLat, indent.getRecords().get(i).getUserLng(), indent.getRecords().get(i).getUserLat());
+                    Object data = distance.get("data");
+                    indent.getRecords().get(i).setDistancess(Double.valueOf(data.toString()));
+                }
+            }
+        }else if("2".equals(receivingPettern)){
+            String address = getCurrentCityByLngAndLat(riderLng, riderLat);
 
+            indent = baseMapper.findNewIndentcity(pages, riderLng, riderLat, address, indentType);
+            for (int i = 0;i<indent.getRecords().size();i++){
+                if("4".equals(indent.getRecords().get(i).getIndentType())){
+                    Result distance = distance(riderLng, riderLat, indent.getRecords().get(i).getUserLng(), indent.getRecords().get(i).getUserLat());
+                    Object data1 = distance.get("data");
+                    indent.getRecords().get(i).setDistancess(Double.valueOf(data1.toString()));
+                }
+            }
+        }
+        return Result.success().put("data",new PageUtils(indent));
+    }
 
     @Override
     public Result insertIndent(TbOrder order) {
@@ -492,30 +523,66 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
     }
 
     @Override
-    public Result findNewIndent(Long userId, String receivingPettern, Integer page, Integer limit, double riderLng, double riderLat, String indentType, String buyType) {
-        Page<TbIndent> pages=new Page<>(page,limit);
-        IPage<TbIndent> indent = null;
-        String address = "";
-        if(receivingPettern.equals("1")){
+    public PageUtils findNewIndent(WaitForAcceptOrderQueryDTO queryDTO) {
+        Page<TbIndent> pages = new Page<>(queryDTO.getPage(), queryDTO.getLimit());
+
+        String receivingPattern = queryDTO.getReceivingPattern();
+
+        IPage<TbIndent> indent;
+        // 接单模式 1近单模式,2同城模式
+        if(ObjectUtil.equal(receivingPattern, "1")) {
             CommonInfo one = commonInfoService.findOne(274);
-            Integer value =Integer.valueOf(one.getValue());
-            double distances = value;
-            indent = baseMapper.findNewIndent(pages, riderLng, riderLat, distances, indentType);
-            for (int i = 0;i<indent.getRecords().size();i++){
-                if("4".equals(indent.getRecords().get(i).getIndentType())){
-                    Result distance = distance(riderLng, riderLat, indent.getRecords().get(i).getUserLng(), indent.getRecords().get(i).getUserLat());
-                    Object data = distance.get("data");
-                    indent.getRecords().get(i).setDistancess(Double.valueOf(data.toString()));
-                }
-            }
-        }else if("2".equals(receivingPettern)){
-            String way = commonInfoService.findOne(416).getValue();
+            queryDTO.setDistances(Double.valueOf(one.getValue()));
+            indent = baseMapper.findNewIndentByDistances(pages, queryDTO);
+        } else {
+            String city = getCurrentCityByLngAndLat(queryDTO.getRiderLng(), queryDTO.getRiderLat());
+            queryDTO.setCity(city);
+
+            indent = baseMapper.findNewIndentByCity(pages, queryDTO);
+        }
+
+        // indentType为4时调用distance()重新计算距离步骤去除
+
+        return new PageUtils(indent);
+    }
+
+    @Override
+    public PageUtils findNewIndentGroupByShop(WaitForAcceptOrderQueryDTO queryDTO) {
+        Page<ShopWaitAcceptOrderVO> pages = new Page<>(queryDTO.getPage(), queryDTO.getLimit());
+
+        String receivingPattern = queryDTO.getReceivingPattern();
+
+        IPage<ShopWaitAcceptOrderVO> indent;
+        // 接单模式 1近单模式,2同城模式
+        if(ObjectUtil.equal(receivingPattern, "1")) {
+            CommonInfo one = commonInfoService.findOne(274);
+            queryDTO.setDistances(Double.valueOf(one.getValue()));
+            indent = baseMapper.findNewIndentByDistancesGroupByShop(pages, queryDTO);
+        } else {
+            String city = getCurrentCityByLngAndLat(queryDTO.getRiderLng(), queryDTO.getRiderLat());
+            queryDTO.setCity(city);
+
+            indent = baseMapper.findNewIndentByCityGroupByShop(pages, queryDTO);
+        }
+        return new PageUtils(indent);
+    }
+
+    /**
+     * 获取当前经纬度所在城市
+     * @param lng 经度 xxx.yyyy
+     * @param lat 纬度 xx.yyyy
+     * @return 城市名称
+     */
+    private String getCurrentCityByLngAndLat(Double lng, Double lat) {
+        String way = commonInfoService.findOne(416).getValue();
+        String city = null;
+        try {
             if("1".equals(way)){
                 //根据骑手经纬度获取骑手所在城市
                 CommonInfo one = commonInfoService.findOne(235);
                 String url="https://apis.map.qq.com/ws/geocoder/v1/";
                 Map<String,String> maps=new HashMap<>();
-                maps.put("location",riderLat+","+riderLng);
+                maps.put("location", lat + "," + lng);
                 maps.put("key",one.getValue());
                 String data = HttpClientUtil.doGet(url, maps);
                 JSONObject jsonObject = JSON.parseObject(data);
@@ -524,46 +591,39 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
                 if("0".equals(status)){
                     JSONObject result = jsonObject.getJSONObject("result");
                     JSONObject adInfo = result.getJSONObject("ad_info");
-                    if(adInfo!=null){
-                        String province = String.valueOf(adInfo.get("province"));
-                        String city = String.valueOf(adInfo.get("city"));
-                        address = city;
+                    if(adInfo != null){
+                        city = String.valueOf(adInfo.get("city"));
                     }
-
-                }else{
-                    log.error("转换失败!!!原因:"+jsonObject.getString("message"));
                 }
-            }else{
+            } else {
                 String value = commonInfoService.findOne(417).getValue();
                 String url="http://api.tianditu.gov.cn/geocoder";
                 Map<String,String> param=new HashMap<>();
                 JSONObject postStr=new JSONObject();
-                postStr.put("lon",riderLng);
-                postStr.put("lat",riderLat);
-                postStr.put("ver","1");
-                param.put("postStr",postStr.toJSONString());
-                param.put("type","geocode");
-                param.put("tk",value);
+                postStr.put("lon", lng);
+                postStr.put("lat", lat);
+                postStr.put("ver", "1");
+                param.put("postStr", postStr.toJSONString());
+                param.put("type", "geocode");
+                param.put("tk", value);
                 String s = HttpClientUtil.doGet(url,param);
                 JSONObject jsonObject = JSONObject.parseObject(s);
                 String status = jsonObject.getString("status");
                 if("0".equals(status)){
                     JSONObject result = jsonObject.getJSONObject("result");
                     JSONObject addressComponent = result.getJSONObject("addressComponent");
-                    address = addressComponent.getString("city");
+                    city = addressComponent.getString("city");
                 }
             }
+        } catch (Exception e) {
+            throw new SqxException("获取当前用户位置失败,失败原因:【" + e.getMessage() + "】");
+        }
 
-            indent = baseMapper.findNewIndentcity(pages, riderLng, riderLat, address, indentType);
-            for (int i = 0;i<indent.getRecords().size();i++){
-                if("4".equals(indent.getRecords().get(i).getIndentType())){
-                    Result distance = distance(riderLng, riderLat, indent.getRecords().get(i).getUserLng(), indent.getRecords().get(i).getUserLat());
-                    Object data1 = distance.get("data");
-                    indent.getRecords().get(i).setDistancess(Double.valueOf(data1.toString()));
-                }
-            }
+        if (ObjectUtil.isNull(city)) {
+            throw new SqxException("获取当前用户位置失败");
         }
-        return Result.success().put("data",new PageUtils(indent));
+
+        return city;
     }
 
 

+ 22 - 0
src/main/java/com/sqx/modules/errand/vo/ShopWaitAcceptOrderVO.java

@@ -0,0 +1,22 @@
+package com.sqx.modules.errand.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 商家待接单vo
+ */
+@Data
+@ApiModel("商家待接单vo")
+public class ShopWaitAcceptOrderVO {
+
+    @ApiModelProperty("店铺id")
+    private Long shopId;
+
+    @ApiModelProperty("店铺名称")
+    private String shopName;
+
+    @ApiModelProperty("待接单数量")
+    private Long countOfWaitAccept;
+}

+ 100 - 1
src/main/resources/mapper/errand/TbIndentMapper.xml

@@ -21,13 +21,67 @@
         order by create_time desc
     </select>
 
+    <select id="findNewIndentByDistances" resultType="com.sqx.modules.errand.entity.TbIndent">
+        select * from (
+        select ti.*,
+        (st_distance (point (ti.shop_lng,ti.shop_lat),point(#{queryDTO.riderLng},#{queryDTO.riderLat}) ) * 111195) AS distancess,
+        (st_distance (point (ti.user_lng,ti.user_lat),point(#{queryDTO.riderLng},#{queryDTO.riderLat}) ) * 111195) AS distancessd
+        from tb_indent ti
+        where ti.indent_state = 2
+        ) a
+        <where>
+            <if test="queryDTO.distances!= null">
+                and ((distancess is not null and distancess &lt;= #{queryDTO.distances}) or (distancess is null and distancessd &lt;= #{queryDTO.distances}))
+            </if>
+            <if test="queryDTO.indentType != null and queryDTO.indentType != ''">
+                and indent_type = #{queryDTO.indentType}
+            </if>
+            <if test="queryDTO.buyType != null and queryDTO.buyType != ''">
+                and buy_type = #{queryDTO.buyType}
+            </if>
+            <if test="queryDTO.shopId != null">
+                and shop_id = #{queryDTO.shopId}
+            </if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <select id="findNewIndentByDistancesGroupByShop" resultType="com.sqx.modules.errand.vo.ShopWaitAcceptOrderVO">
+        select shop_id, shop_name, count(indent_id) as countOfWaitAccept from (
+            select
+                shop_id, shop_name, indent_id,
+                (st_distance(point(shop_lng,shop_lat), point(#{queryDTO.riderLng}, #{queryDTO.riderLat})) * 111195) AS distancess,
+                (st_distance(point(user_lng,user_lat), point(#{queryDTO.riderLng}, #{queryDTO.riderLat})) * 111195) AS distancessd
+            from
+                tb_indent
+        ) a
+        <where>
+            <if test="queryDTO.distances!= null">
+                and ((distancess is not null and distancess &lt;= #{queryDTO.distances}) or (distancess is null and distancessd &lt;= #{queryDTO.distances}))
+            </if>
+            <if test="queryDTO.indentType != null and queryDTO.indentType != ''">
+                and indent_type = #{queryDTO.indentType}
+            </if>
+            <if test="queryDTO.buyType != null and queryDTO.buyType != ''">
+                and buy_type = #{queryDTO.buyType}
+            </if>
+            <if test="queryDTO.shopId != null">
+                and shop_id = #{queryDTO.shopId}
+            </if>
+        </where>
+        group by
+            shop_id
+        order by
+            distancess asc
+    </select>
+
     <select id="findNewIndentcity" resultType="com.sqx.modules.errand.entity.TbIndent">
         select * from (
         select ti.*,
         (st_distance (point (ti.shop_lng,ti.shop_lat),point(#{riderLng},#{riderLat}) ) *111195) AS distancess,
         (st_distance (point (ti.user_lng,ti.user_lat),point(#{riderLng},#{riderLat}) ) *111195) AS distancessd
         from tb_indent ti
-        where ti.indent_state = 2
+        <!-- todo where ti.indent_state = 2 -->
         ) a
         where
         user_city like concat('%',#{address},'%')
@@ -37,6 +91,51 @@
         order by distancess asc
     </select>
 
+    <select id="findNewIndentByCity" resultType="com.sqx.modules.errand.entity.TbIndent">
+        select * from (
+        select ti.*,
+        (st_distance (point (ti.shop_lng,ti.shop_lat),point(#{queryDTO.riderLng},#{queryDTO.riderLat}) ) * 111195) AS distancess,
+        (st_distance (point (ti.user_lng,ti.user_lat),point(#{queryDTO.riderLng},#{queryDTO.riderLat}) ) * 111195) AS distancessd
+        from tb_indent ti
+        <!-- todo where ti.indent_state = 2-->
+        ) a
+        where
+        user_city like concat('%',#{queryDTO.city},'%')
+        <if test="queryDTO.indentType!=null and queryDTO.indentType!=''">
+            and indent_type = #{queryDTO.indentType}
+        </if>
+        <if test="queryDTO.buyType != null and queryDTO.buyType != ''">
+            and buy_type = #{queryDTO.buyType}
+        </if>
+        <if test="queryDTO.shopId != null">
+            and shop_id = #{queryDTO.shopId}
+        </if>
+        order by distancess asc
+    </select>
+
+    <select id="findNewIndentByCityGroupByShop" resultType="com.sqx.modules.errand.vo.ShopWaitAcceptOrderVO">
+        select
+            shop_id, shop_name, count(indent_id) as countOfWaitAccept,
+            (st_distance_sphere (point (shop_lng,shop_lat),point(115.82770500,28.70783200))) AS distancess
+        from
+            tb_indent
+        where
+            shop_city like concat('%',#{queryDTO.city},'%')
+        <if test="queryDTO.indentType!=null and queryDTO.indentType!=''">
+            and indent_type = #{queryDTO.indentType}
+        </if>
+        <if test="queryDTO.buyType != null and queryDTO.buyType != ''">
+            and buy_type = #{queryDTO.buyType}
+        </if>
+        <if test="queryDTO.shopId != null">
+            and shop_id = #{queryDTO.shopId}
+        </if>
+        group by
+            shop_id
+        order by
+            distancess asc
+    </select>
+
     <select id="findIndentByNumber" resultType="com.sqx.modules.errand.entity.TbIndent">
         select *
         from tb_indent