| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QueryOrderListDto { |
| | |
| | | @ApiModelProperty(value="客户姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value="排序字段 1:客户名称 2:下单时间") |
| | | private Integer namePx; |
| | | |
| | | @ApiModelProperty(value="排序方式 1: asc , 2 :aesc") |
| | | private Integer typePx; |
| | | |
| | | @ApiModelProperty(value="状态 1-待发货2-待收货3-已收货4-已完成5-已评价6-已取消") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="下单时间开始时间") |
| | |
| | | package com.xzx.gc.shop.mapper; |
| | | |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.shop.dto.QueryOrderListDto; |
| | | import com.xzx.gc.shop.dto.XcxOrderListDto; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.shop.vo.XcxOrderDetailsVo; |
| | |
| | | public interface ScoreOrderMapper extends GcMapper<ScoreOrder> { |
| | | |
| | | List<QueryOrderListVo> queryOrderList(@Param("name")String name, |
| | | @Param("accountName")String accountName, |
| | | @Param("orderNo")String orderNo, |
| | | @Param("status")Integer status, |
| | | @Param("status") List status, |
| | | @Param("createdTimeStart")Date createdTimeStart, |
| | | @Param("createdTimeEnd")Date createdTimeEnd); |
| | | @Param("createdTimeEnd")Date createdTimeEnd, |
| | | @Param("namePx")Integer namePx, |
| | | @Param("typePx")Integer typePx); |
| | | |
| | | List<XcxOrderListVo> selectXcxOrderList(@Param("record") XcxOrderListDto xcxOrderListDto); |
| | | |
| | |
| | | Map<String, Object> selectOrderStastics(@Param("userId") String userId); |
| | | |
| | | Integer selectScoreOrderCnt(@Param("userId") String userId); |
| | | |
| | | } |
| | |
| | | private IdUtils idUtils; |
| | | |
| | | public Map<String, Object> queryOrderList(QueryOrderListDto model) { |
| | | String accountName = model.getName(); |
| | | String name = StrUtil.isEmpty(model.getName())?model.getName():StringUtils.encode(model.getName()); |
| | | String orderNo = model.getOrderNo(); |
| | | Integer status = model.getStatus() == null ? 0 : model.getStatus(); |
| | | List<Integer> status = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(status)){ |
| | | status = model.getStatus(); |
| | | }else{ |
| | | status.add(1); |
| | | status.add(2); |
| | | status.add(3); |
| | | status.add(4); |
| | | status.add(5); |
| | | status.add(6); |
| | | } |
| | | Date createdTimeStart = model.getCreatedTimeStart(); |
| | | Date createdTimeEnd = model.getCreatedTimeEnd(); |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<QueryOrderListVo> maps = scoreOrderMapper.queryOrderList(name,orderNo,status,createdTimeStart,createdTimeEnd); |
| | | Integer namePx = model.getNamePx() == null ? 2 : model.getNamePx(); |
| | | Integer typePx = model.getTypePx() == null ? 2 : model.getTypePx(); |
| | | List<QueryOrderListVo> maps = scoreOrderMapper.queryOrderList(name,accountName,orderNo,status,createdTimeStart,createdTimeEnd,namePx,typePx); |
| | | if(CollUtil.isNotEmpty(maps)){ |
| | | for(QueryOrderListVo queryOrderListVo : maps){ |
| | | String decode = StringUtils.decode(queryOrderListVo.getName()); |
| | |
| | | </if> |
| | | |
| | | <if test="name != null and name != ''"> |
| | | and b.nick_name like concat('%',#{name},'%') |
| | | and (b.nick_name like concat('%',#{name},'%') |
| | | or b.mobile_phone like concat('%',#{accountName},'%') ) |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | and a.status = #{status} |
| | | <if test="status.size > 0"> |
| | | and a.status in |
| | | <foreach collection="status" item="sta" open="(" separator="," close=")"> |
| | | #{sta} |
| | | </foreach> |
| | | </if> |
| | | <if test="createdTimeStart != null"> |
| | | and a.CREATED_TIME >= #{createdTimeStart} |
| | |
| | | <if test="createdTimeEnd != null"> |
| | | and a.CREATED_TIME <= #{createdTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | order by |
| | | <if test="namePx != null and namePx != '' and namePx == 1"> |
| | | a.CREATED_TIME |
| | | </if> |
| | | <if test="namePx != null and namePx != '' and namePx == 2"> |
| | | from_base64(b.nick_name) |
| | | </if> |
| | | |
| | | <if test="typePx != null and typePx != '' and typePx == 1"> |
| | | asc |
| | | </if> |
| | | <if test="typePx != null and typePx != '' and typePx == 2"> |
| | | desc |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="selectXcxOrderList" resultType="com.xzx.gc.shop.vo.XcxOrderListVo"> |