dev
parent
0d81d80841
commit
4d13c6b822
|
|
@ -67,6 +67,15 @@ public class BizAuditConfigController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/list_all")
|
||||||
|
public R<List<BizAuditConfigEntity>> listAll() {
|
||||||
|
return R.success(bizAuditConfigService.listAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复制文件
|
* 复制文件
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ import com.njzscloud.common.core.ex.Exceptions;
|
||||||
import com.njzscloud.common.core.tuple.Tuple2;
|
import com.njzscloud.common.core.tuple.Tuple2;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.common.security.support.UserDetail;
|
||||||
|
import com.njzscloud.common.security.util.SecurityUtil;
|
||||||
import com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper;
|
import com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper;
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult;
|
import com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult;
|
||||||
|
|
@ -35,6 +37,9 @@ import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static com.njzscloud.supervisory.constant.Constant.ROLE_JG;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核配置
|
* 审核配置
|
||||||
|
|
@ -304,4 +309,26 @@ public class BizAuditConfigService extends ServiceImpl<BizAuditConfigMapper, Biz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<BizAuditConfigEntity> listAll() {
|
||||||
|
UserDetail userDetail = SecurityUtil.loginUser();
|
||||||
|
Set<String> roles = userDetail.getRoles();
|
||||||
|
Assert.isTrue(CollUtil.isNotEmpty(roles) && roles.contains(ROLE_JG), () -> Exceptions.clierr("非监管角色,不能查看"));
|
||||||
|
List<BizAuditConfigEntity> all;
|
||||||
|
if (SecurityUtil.isAdmin()) {
|
||||||
|
all = new ArrayList<>();
|
||||||
|
List<BizAuditConfigEntity> list = list();
|
||||||
|
for (BizAuditConfigEntity bizAuditConfigEntity : list) {
|
||||||
|
if (all.stream().anyMatch(item -> item.getArea().equals(bizAuditConfigEntity.getArea()))) continue;
|
||||||
|
all.add(bizAuditConfigEntity);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<BizAuditConfigEntity> areaList = list(Wrappers.<BizAuditConfigEntity>lambdaQuery().in(BizAuditConfigEntity::getAreaRole, roles));
|
||||||
|
List<BizAuditConfigEntity> cityList = list(Wrappers.<BizAuditConfigEntity>lambdaQuery().in(BizAuditConfigEntity::getCityRole, roles)
|
||||||
|
.notIn(BizAuditConfigEntity::getArea, areaList.stream().map(BizAuditConfigEntity::getArea).collect(Collectors.toList())));
|
||||||
|
all = Stream.of(areaList, cityList)
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,4 +298,20 @@ public class OrderInfoController {
|
||||||
return R.success(orderInfoService.pushProvincial(orderSns));
|
return R.success(orderInfoService.pushProvincial(orderSns));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/statistics")
|
||||||
|
public R<?> statistics(OrderStatisticsParam param) {
|
||||||
|
return R.success(orderInfoService.statistics(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单统计详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/statistics/detail")
|
||||||
|
public R<?> statisticsDetail(PageParam pageParam, OrderPagingSearchParam param) {
|
||||||
|
return R.success(orderInfoService.statisticsDetail(pageParam, param));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单信息
|
* 订单信息
|
||||||
|
|
@ -49,4 +50,10 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||||
DeviceLocalizerEntity gpsLastOnlineTime(@Param("gpsId") String gpsId);
|
DeviceLocalizerEntity gpsLastOnlineTime(@Param("gpsId") String gpsId);
|
||||||
|
|
||||||
List<String> getRoute(@Param("id") Long id);
|
List<String> getRoute(@Param("id") Long id);
|
||||||
|
|
||||||
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
|
List<Map<String, Object>> statisticsByArea(@Param("ew") QueryWrapper<Object> ew);
|
||||||
|
|
||||||
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
|
List<Map<String, Object>> statisticsByAreaGoods(@Param("ew") QueryWrapper<Object> ew);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,10 @@ public class OrderPagingSearchParam {
|
||||||
* 昵称
|
* 昵称
|
||||||
*/
|
*/
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 手机号
|
||||||
|
|
@ -77,6 +81,8 @@ public class OrderPagingSearchParam {
|
||||||
|
|
||||||
private LocalDateTime startPayTime;
|
private LocalDateTime startPayTime;
|
||||||
private LocalDateTime endPayTime;
|
private LocalDateTime endPayTime;
|
||||||
|
private LocalDateTime startOutTime;
|
||||||
|
private LocalDateTime endOutTime;
|
||||||
|
|
||||||
private Boolean isCertificatePaging = Boolean.FALSE;
|
private Boolean isCertificatePaging = Boolean.FALSE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.njzscloud.supervisory.order.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OrderStatisticsParam {
|
||||||
|
/**
|
||||||
|
* 区域编码
|
||||||
|
*/
|
||||||
|
private List<String> areaCode;
|
||||||
|
/**
|
||||||
|
* 产品 Id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
/**
|
||||||
|
* 年份
|
||||||
|
*/
|
||||||
|
private Integer year;
|
||||||
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
|
private Integer month;
|
||||||
|
}
|
||||||
|
|
@ -242,6 +242,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
String driverName = orderPagingSearchParam.getDriverName();
|
String driverName = orderPagingSearchParam.getDriverName();
|
||||||
LocalDateTime startPayTime = orderPagingSearchParam.getStartPayTime();
|
LocalDateTime startPayTime = orderPagingSearchParam.getStartPayTime();
|
||||||
LocalDateTime endPayTime = orderPagingSearchParam.getEndPayTime();
|
LocalDateTime endPayTime = orderPagingSearchParam.getEndPayTime();
|
||||||
|
LocalDateTime startOutTime = orderPagingSearchParam.getStartOutTime();
|
||||||
|
LocalDateTime endOutTime = orderPagingSearchParam.getEndOutTime();
|
||||||
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
||||||
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
|
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
|
||||||
|
|
@ -252,6 +254,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.like(StrUtil.isNotBlank(driverName), "f.driver_name", driverName)
|
.like(StrUtil.isNotBlank(driverName), "f.driver_name", driverName)
|
||||||
.ge(startTime != null, "a.create_time", startTime)
|
.ge(startTime != null, "a.create_time", startTime)
|
||||||
.le(endTime != null, "a.create_time", endTime)
|
.le(endTime != null, "a.create_time", endTime)
|
||||||
|
.ge(startOutTime != null, "d.out_time", startOutTime)
|
||||||
|
.le(endOutTime != null, "d.out_time", endOutTime)
|
||||||
.eq(orderCategory != null, "a.order_category", orderCategory)
|
.eq(orderCategory != null, "a.order_category", orderCategory)
|
||||||
.eq(null != transCompanyId, "a.trans_company_id", transCompanyId)
|
.eq(null != transCompanyId, "a.trans_company_id", transCompanyId)
|
||||||
.eq("a.deleted", 0)
|
.eq("a.deleted", 0)
|
||||||
|
|
@ -545,7 +549,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
);
|
);
|
||||||
} else if (auditStatus == AuditStatus.BoHui) {
|
} else if (auditStatus == AuditStatus.BoHui) {
|
||||||
ew
|
ew
|
||||||
|
.and(it -> it
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
|
.or(it1 -> it1.eq("a.audit_status", AuditStatus.BoHui).eq("a.order_status", OrderStatus.YiQuXiao))
|
||||||
|
)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.BoHui))
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.BoHui))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.BoHui))
|
||||||
|
|
@ -556,7 +563,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
String auditType = orderPagingSearchParam.getAuditType();
|
String auditType = orderPagingSearchParam.getAuditType();
|
||||||
// 1-->待审核
|
// 1-->待审核
|
||||||
if ("1".equals(auditType)) {
|
if ("1".equals(auditType)) {
|
||||||
ew.eq("a.order_status", OrderStatus.YiJieDan)
|
ew
|
||||||
|
.eq("a.order_status", OrderStatus.YiJieDan)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.QuDaiShenHe, AuditStatus.ShiDaiShenHe))
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.QuDaiShenHe, AuditStatus.ShiDaiShenHe))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||||
|
|
@ -564,7 +572,9 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
);
|
);
|
||||||
} else if ("2".equals(auditType)) { // 2-->已审核
|
} else if ("2".equals(auditType)) { // 2-->已审核
|
||||||
ew
|
ew
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.and(it -> it.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
|
.or(it1 -> it1.eq("a.audit_status", AuditStatus.BoHui).eq("a.order_status", OrderStatus.YiQuXiao))
|
||||||
|
)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.ShiDaiShenHe, AuditStatus.TongGuo))
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.ShiDaiShenHe, AuditStatus.TongGuo))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
||||||
|
|
@ -572,7 +582,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ew
|
ew
|
||||||
|
.and(it -> it
|
||||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||||
|
.or(it1 -> it1.eq("a.audit_status", AuditStatus.BoHui).eq("a.order_status", OrderStatus.YiQuXiao))
|
||||||
|
)
|
||||||
.and(it ->
|
.and(it ->
|
||||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList))
|
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList))
|
||||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList))
|
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList))
|
||||||
|
|
@ -670,6 +683,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.setQuAuditMemo(quAuditMemo)
|
.setQuAuditMemo(quAuditMemo)
|
||||||
.setCertificateSn(certificateSn)
|
.setCertificateSn(certificateSn)
|
||||||
.setCheckStatus(checkStatus)
|
.setCheckStatus(checkStatus)
|
||||||
|
.setOrderStatus(newAuditStatus == AuditStatus.BoHui ? OrderStatus.YiQuXiao : null)
|
||||||
);
|
);
|
||||||
if (newAuditStatus == AuditStatus.BoHui) {
|
if (newAuditStatus == AuditStatus.BoHui) {
|
||||||
baseMapper.busyDriver(detail.getDriverId(), Boolean.FALSE);
|
baseMapper.busyDriver(detail.getDriverId(), Boolean.FALSE);
|
||||||
|
|
@ -2274,4 +2288,76 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> statistics(OrderStatisticsParam param) {
|
||||||
|
List<String> areaCode = param.getAreaCode();
|
||||||
|
Long goodsId = param.getGoodsId();
|
||||||
|
Integer year = param.getYear();
|
||||||
|
Integer month = param.getMonth();
|
||||||
|
LocalDateTime start = null;
|
||||||
|
LocalDateTime end = null;
|
||||||
|
if (year != null) {
|
||||||
|
if (month == null) {
|
||||||
|
start = LocalDateTime.of(year, 1, 1, 0, 0, 0);
|
||||||
|
end = LocalDateTime.of(year, 12, 31, 23, 59, 59);
|
||||||
|
} else {
|
||||||
|
start = LocalDateTime.of(year, month, 1, 0, 0, 0);
|
||||||
|
end = start.plusMonths(1).minusSeconds(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map<String, Object>> statisticsByArea = baseMapper.statisticsByArea(Wrappers.query()
|
||||||
|
.in(CollUtil.isNotEmpty(areaCode), "b.area", areaCode)
|
||||||
|
.eq("a.deleted", 0)
|
||||||
|
.in("a.order_status", OrderStatus.YiWanCheng, OrderStatus.YiChuChang)
|
||||||
|
.groupBy("b.area")
|
||||||
|
);
|
||||||
|
List<Map<String, Object>> statisticsByAreaGoods = baseMapper.statisticsByAreaGoods(Wrappers.query()
|
||||||
|
.in(CollUtil.isNotEmpty(areaCode), "b.area", areaCode)
|
||||||
|
.eq("a.deleted", 0)
|
||||||
|
.between(start != null, "a.create_time", start, end)
|
||||||
|
.eq(goodsId != null, "d.origin_goods_id", goodsId)
|
||||||
|
.in("a.order_status", OrderStatus.YiWanCheng, OrderStatus.YiChuChang)
|
||||||
|
.groupBy("b.area", "d.origin_goods_id")
|
||||||
|
);
|
||||||
|
return MapUtil.<String, Object>builder()
|
||||||
|
.put("statisticsByArea", statisticsByArea)
|
||||||
|
.put("statisticsByAreaGoods", statisticsByAreaGoods)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageResult<OrderPagingResult> statisticsDetail(PageParam pageParam, OrderPagingSearchParam orderPagingSearchParam) {
|
||||||
|
String area = orderPagingSearchParam.getArea();
|
||||||
|
Long goodsId = orderPagingSearchParam.getGoodsId();
|
||||||
|
String sn = orderPagingSearchParam.getSn();
|
||||||
|
// 客户名称
|
||||||
|
String nickname = orderPagingSearchParam.getNickname();
|
||||||
|
// 产废单位
|
||||||
|
String companyName = orderPagingSearchParam.getCompanyName();
|
||||||
|
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
|
||||||
|
String licensePlate = orderPagingSearchParam.getLicensePlate();
|
||||||
|
|
||||||
|
LocalDateTime startTime = orderPagingSearchParam.getStartTime();
|
||||||
|
LocalDateTime endTime = orderPagingSearchParam.getEndTime();
|
||||||
|
|
||||||
|
LocalDateTime startOutTime = orderPagingSearchParam.getStartOutTime();
|
||||||
|
LocalDateTime endOutTime = orderPagingSearchParam.getEndOutTime();
|
||||||
|
|
||||||
|
Page<OrderPagingResult> page = pageParam.toPage();
|
||||||
|
|
||||||
|
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
||||||
|
.eq("a.deleted", 0)
|
||||||
|
.eq("b.area", area)
|
||||||
|
.eq("c.origin_goods_id", goodsId)
|
||||||
|
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
|
||||||
|
.like(StrUtil.isNotBlank(nickname), "a.contacts", nickname)
|
||||||
|
.like(StrUtil.isNotBlank(companyName), "j.company_name", companyName)
|
||||||
|
.like(StrUtil.isNotBlank(transCompanyName), "g.company_name", transCompanyName)
|
||||||
|
.like(StrUtil.isNotBlank(licensePlate), "e.license_plate", licensePlate)
|
||||||
|
.ge(startTime != null, "a.create_time", startTime)
|
||||||
|
.le(endTime != null, "a.create_time", endTime)
|
||||||
|
.ge(startOutTime != null, "d.out_time", startOutTime)
|
||||||
|
.le(endOutTime != null, "d.out_time", endOutTime);
|
||||||
|
return PageResult.of(baseMapper.paging(page, ew));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -373,4 +373,31 @@
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
ORDER BY b.sort, b.create_time, b.id
|
ORDER BY b.sort, b.create_time, b.id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="statisticsByArea" resultType="java.util.Map">
|
||||||
|
SELECT t3.district_name area, t1.weight
|
||||||
|
FROM (SELECT b.area area_code, IFNULL(SUM(c.settle_weight), 0) weight
|
||||||
|
FROM order_info a
|
||||||
|
INNER JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||||
|
INNER JOIN order_car_in_out c ON c.id = a.car_in_out_id
|
||||||
|
INNER JOIN order_goods d ON d.id = a.goods_id
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
) t1
|
||||||
|
INNER JOIN sys_district t3 ON t3.id = t1.area_code
|
||||||
|
</select>
|
||||||
|
<select id="statisticsByAreaGoods" resultType="java.util.Map">
|
||||||
|
SELECT t1.goods_id goodsId,t2.goods_name goodsName, t1.area_code areaCode, t3.district_name area, t1.weight
|
||||||
|
FROM (SELECT b.area area_code, d.origin_goods_id goods_id, IFNULL(SUM(c.settle_weight), 0) weight
|
||||||
|
FROM order_info a
|
||||||
|
INNER JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||||
|
INNER JOIN order_car_in_out c ON c.id = a.car_in_out_id
|
||||||
|
INNER JOIN order_goods d ON d.id = a.goods_id
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
) t1
|
||||||
|
INNER JOIN goods_info t2 ON t2.id = t1.goods_id
|
||||||
|
INNER JOIN sys_district t3 ON t3.id = t1.area_code
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue