parent
046942137b
commit
0924c2c2ec
2 changed files with 159 additions and 0 deletions
@ -0,0 +1,117 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="org.springblade.wms.mapper.StStorageLocationMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="stStorageLocationResultMap" type="org.springblade.wms.pojo.entity.StStorageLocation"> |
||||||
|
<result column="ID" property="id"/> |
||||||
|
<result column="TENANT_ID" property="tenantId"/> |
||||||
|
<result column="CREATE_USER" property="createUser"/> |
||||||
|
<result column="CREATE_DEPT" property="createDept"/> |
||||||
|
<result column="CREATE_TIME" property="createTime"/> |
||||||
|
<result column="UPDATE_USER" property="updateUser"/> |
||||||
|
<result column="UPDATE_TIME" property="updateTime"/> |
||||||
|
<result column="STATUS" property="status"/> |
||||||
|
<result column="IS_DELETED" property="isDeleted"/> |
||||||
|
<result column="SH_ID" property="shId"/> |
||||||
|
<result column="LOCATION" property="location"/> |
||||||
|
<result column="GOODS_CODE" property="goodsCode"/> |
||||||
|
<result column="GOODS_NAME" property="goodsName"/> |
||||||
|
<result column="SPECIFICATIONS" property="specifications"/> |
||||||
|
<result column="MATERIAL_MODEL" property="materialModel"/> |
||||||
|
<result column="DEPT_ID" property="deptId"/> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
|
||||||
|
<select id="selectStStorageLocationPage" resultMap="stStorageLocationResultMap"> |
||||||
|
select * from ST_STORAGE_LOCATION where is_deleted = 0 |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="selectStStorageLocationAllPage" resultMap="stStorageLocationResultMap"> |
||||||
|
SELECT t.* |
||||||
|
FROM st_storage_location t |
||||||
|
LEFT JOIN st_storehouse s ON t.sh_id = s.id |
||||||
|
<where> |
||||||
|
AND t.is_deleted = 0 |
||||||
|
<!-- 原逻辑:shId 等值匹配(传值则生效) --> |
||||||
|
<if test="shId != null"> |
||||||
|
AND s.id = #{shId} |
||||||
|
</if> |
||||||
|
</where> |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="selectListByShIdAndStockExists" resultType="org.springblade.wms.pojo.entity.StStorageLocation"> |
||||||
|
SELECT sl.* |
||||||
|
FROM st_storage_location sl |
||||||
|
WHERE sl.sh_id = #{shId} |
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 |
||||||
|
FROM st_realtime_stock rls |
||||||
|
WHERE rls.sl_id = sl.id |
||||||
|
) |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="checkLocation" resultMap="stStorageLocationResultMap"> |
||||||
|
SELECT * |
||||||
|
FROM ( |
||||||
|
SELECT * FROM ST_STORAGE_LOCATION |
||||||
|
WHERE SH_ID = #{shId} |
||||||
|
AND LOCATION = #{location} |
||||||
|
AND IS_DELETED = 0 |
||||||
|
) |
||||||
|
WHERE ROWNUM = 1 |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="findByGoodsCode" resultMap="stStorageLocationResultMap"> |
||||||
|
SELECT * |
||||||
|
FROM ( |
||||||
|
SELECT * |
||||||
|
FROM ST_STORAGE_LOCATION |
||||||
|
WHERE GOODS_CODE = #{goodsCode} |
||||||
|
AND IS_DELETED = 0 |
||||||
|
) |
||||||
|
WHERE ROWNUM = 1 |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="findByLocation" resultMap="stStorageLocationResultMap"> |
||||||
|
SELECT * |
||||||
|
FROM ST_STORAGE_LOCATION |
||||||
|
WHERE LOCATION = #{location} |
||||||
|
AND DELETED = 0 |
||||||
|
AND ROWNUM = 1 |
||||||
|
</select> |
||||||
|
|
||||||
|
<!-- <select id="selectLocationWithHouse" resultMap="locationWithHouseMap">--> |
||||||
|
<!-- SELECT sl.*,--> |
||||||
|
<!-- sh.id AS sh_id,--> |
||||||
|
<!-- sh.sh_code AS sh_sh_code,--> |
||||||
|
<!-- sh.sh_name AS sh_sh_name,--> |
||||||
|
<!-- sh.house_type AS sh_house_type,--> |
||||||
|
<!-- sh.tooling_type AS sh_tooling_type,--> |
||||||
|
<!-- sh.sh_level AS sh_sh_level,--> |
||||||
|
<!-- sh.factory_id AS sh_factory_id,--> |
||||||
|
<!-- sh.save_user AS sh_save_user,--> |
||||||
|
<!-- sh.memo AS sh_memo--> |
||||||
|
<!-- FROM ST_STORAGE_LOCATION sl--> |
||||||
|
<!-- LEFT JOIN ST_STOREHOUSE sh ON sl.sh_id = sh.id--> |
||||||
|
<!-- WHERE sl.id = #{id}--> |
||||||
|
<!-- </select>--> |
||||||
|
|
||||||
|
<!-- <resultMap id="locationWithHouseMap" type="org.springblade.wms.pojo.entity.StStorageLocation">--> |
||||||
|
<!-- <!– 库存自身主键、外键 –>--> |
||||||
|
<!-- <id property="id" column="id"/>--> |
||||||
|
<!-- <result property="shId" column="sh_id"/>--> |
||||||
|
<!-- <!– 其他库存字段可自动映射 –>--> |
||||||
|
|
||||||
|
<!-- <!– 一对一:把 g_ 前缀的列整体丢进已有的 stGoodsResultMap –>--> |
||||||
|
<!-- <association property="stStorehouse"--> |
||||||
|
<!-- resultMap="org.springblade.wms.mapper.StStorehouseMapper.stStorehouseResultMap"--> |
||||||
|
<!-- columnPrefix="sh_"/>--> |
||||||
|
<!-- </resultMap>--> |
||||||
|
|
||||||
|
|
||||||
|
<select id="exportStStorageLocation" resultType="org.springblade.wms.excel.StStorageLocationExcel"> |
||||||
|
SELECT * FROM ST_STORAGE_LOCATION ${ew.customSqlSegment} |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
||||||
@ -0,0 +1,42 @@ |
|||||||
|
package org.springblade.wms.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.wms.excel.StStoreBillExcel; |
||||||
|
import org.springblade.wms.pojo.entity.StStoreBill; |
||||||
|
import org.springblade.wms.pojo.vo.StStoreBillVO; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @version 1.0 |
||||||
|
* @program: jonhon-mes-svr |
||||||
|
* @ClassName IStStoreBillService |
||||||
|
* @description: 仓库凭证 服务类 |
||||||
|
* @autor: WuSiYu |
||||||
|
* @create 2026-01-15 13:28 |
||||||
|
**/ |
||||||
|
|
||||||
|
public interface IStStoreBillService extends BaseService<StStoreBill> { |
||||||
|
/** |
||||||
|
* 自定义分页 |
||||||
|
* |
||||||
|
* @param page 分页参数 |
||||||
|
* @param stStoreBill 查询参数 |
||||||
|
* @return IPage<StStoreBillVO> |
||||||
|
*/ |
||||||
|
IPage<StStoreBillVO> selectStStoreBillPage(IPage<StStoreBillVO> page, StStoreBillVO stStoreBill); |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 导出数据 |
||||||
|
* |
||||||
|
* @param queryWrapper 查询条件 |
||||||
|
* @return List<StStoreBillExcel> |
||||||
|
*/ |
||||||
|
List<StStoreBillExcel> exportStStoreBill(Wrapper<StStoreBill> queryWrapper); |
||||||
|
|
||||||
|
String nextCode(Short obj); |
||||||
|
} |
||||||
|
|
||||||
Loading…
Reference in new issue