出库下拉选择模具sql优化

main
judy 11 months ago
parent db0d7389b0
commit 807a0615cc
  1. 2
      shkj-admin/src/main/resources/application-pro.yml
  2. 2
      shkj-wms/src/main/java/com/shkj/wms/service/impl/SysAppVersionServiceImpl.java
  3. 4
      shkj-wms/src/main/resources/mapper/wms/BaseMoldMapper.xml

@ -12,7 +12,7 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://localhost:3306/kmv2_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B7 url: jdbc:mysql://192.168.155.145:3306/kmv2_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B7
username: root username: root
password: Mjk@2024_Kmv2 password: Mjk@2024_Kmv2
# 从库数据源 # 从库数据源

@ -86,7 +86,7 @@ public class SysAppVersionServiceImpl extends ServiceImpl<SysAppVersionMapper, S
.orderByDesc(SysAppVersion::getCreateTime) .orderByDesc(SysAppVersion::getCreateTime)
.last("limit 1")); .last("limit 1"));
if (one == null) { if (one == null) {
return Result.err().msg("没有版本"); // return Result.err().msg("没有版本");
} }
if (!one.getCode().equals(code) || StringUtils.isBlank(code)) { if (!one.getCode().equals(code) || StringUtils.isBlank(code)) {

@ -76,10 +76,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
base_mold m base_mold m
INNER JOIN sys_stock_detail s ON m.id = s.mold_id AND s.qty - s.out_qty > 0 INNER JOIN sys_stock_detail s ON m.id = s.mold_id AND s.qty - s.out_qty > 0
INNER JOIN base_container c on c.id =s.container_id INNER JOIN base_container c on c.id =s.container_id
LEFT JOIN ( SELECT plan.mold_id FROM busin_out_in_plan plan WHERE plan_status NOT IN ( '2', '3' ) AND plan.type = 'out' ) AS planout ON planout.mold_id = m.id
WHERE WHERE
planout.mold_id IS NULL m.is_activity = 1
AND m.is_activity = 1
AND m.is_del = 0 AND m.is_del = 0
<if test="moldBarcode != null and moldBarcode != ''"> <if test="moldBarcode != null and moldBarcode != ''">
and m.bar_code like CONCAT('%', #{moldBarcode},'%') and m.bar_code like CONCAT('%', #{moldBarcode},'%')

Loading…
Cancel
Save