入库相关接口开发

This commit is contained in:
2025-05-30 16:13:27 +08:00
parent 8694b17db4
commit 68f96b9872
60 changed files with 3568 additions and 194 deletions

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zg.project.Information.mapper.DeviceInfoMapper">
<mapper namespace="com.zg.project.information.mapper.DeviceInfoMapper">
<resultMap type="DeviceInfo" id="DeviceInfoResult">
<result property="deviceId" column="device_id" />

View File

@@ -0,0 +1,85 @@
<?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="com.zg.project.information.mapper.MaterialTypeMapper">
<resultMap type="MaterialType" id="MaterialTypeResult">
<result property="id" column="id" />
<result property="typeCode" column="type_code" />
<result property="typeName" column="type_name" />
<result property="status" column="status" />
<result property="sort" column="sort" />
<result property="remark" column="remark" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectMaterialTypeVo">
select id, type_code, type_name, status, sort, remark, created_at, updated_at from material_type
</sql>
<select id="selectMaterialTypeList" parameterType="MaterialType" resultMap="MaterialTypeResult">
<include refid="selectMaterialTypeVo"/>
<where>
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if>
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectMaterialTypeById" parameterType="Long" resultMap="MaterialTypeResult">
<include refid="selectMaterialTypeVo"/>
where id = #{id}
</select>
<insert id="insertMaterialType" parameterType="MaterialType" useGeneratedKeys="true" keyProperty="id">
insert into material_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">type_code,</if>
<if test="typeName != null and typeName != ''">type_name,</if>
<if test="status != null">status,</if>
<if test="sort != null">sort,</if>
<if test="remark != null">remark,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">#{typeCode},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="status != null">#{status},</if>
<if test="sort != null">#{sort},</if>
<if test="remark != null">#{remark},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateMaterialType" parameterType="MaterialType">
update material_type
<trim prefix="SET" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">type_code = #{typeCode},</if>
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
<if test="status != null">status = #{status},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMaterialTypeById" parameterType="Long">
delete from material_type where id = #{id}
</delete>
<delete id="deleteMaterialTypeByIds" parameterType="String">
delete from material_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,118 @@
<?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="com.zg.project.information.mapper.PcdeDetailMapper">
<resultMap type="PcdeDetail" id="PcdeDetailResult">
<result property="id" column="id" />
<result property="locationCode" column="location_code" />
<result property="scene" column="scene" />
<result property="sceneName" column="scene_name" />
<result property="warehouse" column="warehouse" />
<result property="encodedId" column="encoded_id" />
<result property="tag" column="tag" />
<result property="remark" column="remark"/>
<result property="isDelete" column="is_delete" />
<result property="createdBy" column="created_by" />
<result property="createdAt" column="created_at" />
<result property="updatedBy" column="updated_by" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectPcdeDetailVo">
select d.id, d.location_code, d.scene, m.scene_name, d.warehouse,
d.encoded_id, d.tag, d.remark, d.is_delete,
d.created_by, d.created_at, d.updated_by, d.updated_at
from pcde_detail d
left join scene_mapping m on d.scene = m.scene_code
</sql>
<select id="selectPcdeDetailList" parameterType="PcdeDetail" resultMap="PcdeDetailResult">
<include refid="selectPcdeDetailVo"/>
<where>
<if test="locationCode != null and locationCode != ''"> and d.location_code = #{locationCode}</if>
<if test="scene != null and scene != ''"> and d.scene = #{scene}</if>
<if test="warehouse != null and warehouse != ''"> and d.warehouse = #{warehouse}</if>
<if test="encodedId != null and encodedId != ''"> and d.encoded_id = #{encodedId}</if>
<if test="tag != null and tag != ''"> and d.tag = #{tag}</if>
<if test="isDelete != null "> and d.is_delete = #{isDelete}</if>
<if test="createdBy != null and createdBy != ''"> and d.created_by = #{createdBy}</if>
<if test="createdAt != null "> and d.created_at = #{createdAt}</if>
<if test="updatedBy != null and updatedBy != ''"> and d.updated_by = #{updatedBy}</if>
<if test="updatedAt != null "> and d.updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectPcdeDetailById" parameterType="Long" resultMap="PcdeDetailResult">
<include refid="selectPcdeDetailVo"/>
where d.id = #{id}
</select>
<select id="selectByLocationCode" resultType="com.zg.project.information.domain.PcdeDetail"
parameterType="java.lang.String">
select id, location_code, scene, warehouse, encoded_id, tag, is_delete,
created_by, created_at, updated_by, updated_at, remark
from pcde_detail
where location_code = #{locationCode}
</select>
<insert id="insertPcdeDetail" parameterType="PcdeDetail" useGeneratedKeys="true" keyProperty="id">
insert into pcde_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="scene != null and scene != ''">scene,</if>
<if test="warehouse != null and warehouse != ''">warehouse,</if>
<if test="encodedId != null">encoded_id,</if>
<if test="tag != null">tag,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="scene != null and scene != ''">#{scene},</if>
<if test="warehouse != null and warehouse != ''">#{warehouse},</if>
<if test="encodedId != null">#{encodedId},</if>
<if test="tag != null">#{tag},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updatePcdeDetail" parameterType="PcdeDetail">
update pcde_detail
<trim prefix="SET" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="scene != null and scene != ''">scene = #{scene},</if>
<if test="warehouse != null and warehouse != ''">warehouse = #{warehouse},</if>
<if test="encodedId != null">encoded_id = #{encodedId},</if>
<if test="tag != null">tag = #{tag},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePcdeDetailById" parameterType="Long">
delete from pcde_detail where id = #{id}
</delete>
<delete id="deletePcdeDetailByIds" parameterType="String">
delete from pcde_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zg.project.Information.mapper.SceneMappingMapper">
<mapper namespace="com.zg.project.information.mapper.SceneMappingMapper">
<resultMap type="SceneMapping" id="SceneMappingResult">
<result property="id" column="id" />

View File

@@ -0,0 +1,85 @@
<?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="com.zg.project.information.mapper.StockInTypeMapper">
<resultMap type="StockInType" id="StockInTypeResult">
<result property="id" column="id" />
<result property="typeCode" column="type_code" />
<result property="typeName" column="type_name" />
<result property="status" column="status" />
<result property="sort" column="sort" />
<result property="remark" column="remark" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectStockInTypeVo">
select id, type_code, type_name, status, sort, remark, created_at, updated_at from stock_in_type
</sql>
<select id="selectStockInTypeList" parameterType="StockInType" resultMap="StockInTypeResult">
<include refid="selectStockInTypeVo"/>
<where>
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if>
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectStockInTypeById" parameterType="Long" resultMap="StockInTypeResult">
<include refid="selectStockInTypeVo"/>
where id = #{id}
</select>
<insert id="insertStockInType" parameterType="StockInType" useGeneratedKeys="true" keyProperty="id">
insert into stock_in_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">type_code,</if>
<if test="typeName != null and typeName != ''">type_name,</if>
<if test="status != null">status,</if>
<if test="sort != null">sort,</if>
<if test="remark != null">remark,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">#{typeCode},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="status != null">#{status},</if>
<if test="sort != null">#{sort},</if>
<if test="remark != null">#{remark},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateStockInType" parameterType="StockInType">
update stock_in_type
<trim prefix="SET" suffixOverrides=",">
<if test="typeCode != null and typeCode != ''">type_code = #{typeCode},</if>
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
<if test="status != null">status = #{status},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStockInTypeById" parameterType="Long">
delete from stock_in_type where id = #{id}
</delete>
<delete id="deleteStockInTypeByIds" parameterType="String">
delete from stock_in_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,90 @@
<?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="com.zg.project.information.mapper.WarehouseInfoMapper">
<resultMap type="WarehouseInfo" id="WarehouseInfoResult">
<result property="id" column="id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="address" column="address" />
<result property="status" column="status" />
<result property="sort" column="sort" />
<result property="remark" column="remark" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectWarehouseInfoVo">
select id, warehouse_code, warehouse_name, address, status, sort, remark, created_at, updated_at from warehouse_info
</sql>
<select id="selectWarehouseInfoList" parameterType="WarehouseInfo" resultMap="WarehouseInfoResult">
<include refid="selectWarehouseInfoVo"/>
<where>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="status != null "> and status = #{status}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectWarehouseInfoById" parameterType="Long" resultMap="WarehouseInfoResult">
<include refid="selectWarehouseInfoVo"/>
where id = #{id}
</select>
<insert id="insertWarehouseInfo" parameterType="WarehouseInfo" useGeneratedKeys="true" keyProperty="id">
insert into warehouse_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code,</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
<if test="address != null">address,</if>
<if test="status != null">status,</if>
<if test="sort != null">sort,</if>
<if test="remark != null">remark,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseCode != null and warehouseCode != ''">#{warehouseCode},</if>
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
<if test="address != null">#{address},</if>
<if test="status != null">#{status},</if>
<if test="sort != null">#{sort},</if>
<if test="remark != null">#{remark},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateWarehouseInfo" parameterType="WarehouseInfo">
update warehouse_info
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code = #{warehouseCode},</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
<if test="address != null">address = #{address},</if>
<if test="status != null">status = #{status},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWarehouseInfoById" parameterType="Long">
delete from warehouse_info where id = #{id}
</delete>
<delete id="deleteWarehouseInfoByIds" parameterType="String">
delete from warehouse_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>