入库相关接口开发
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
118
src/main/resources/mybatis/information/PcdeDetailMapper.xml
Normal file
118
src/main/resources/mybatis/information/PcdeDetailMapper.xml
Normal 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>
|
||||
@@ -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" />
|
||||
|
||||
85
src/main/resources/mybatis/information/StockInTypeMapper.xml
Normal file
85
src/main/resources/mybatis/information/StockInTypeMapper.xml
Normal 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>
|
||||
@@ -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>
|
||||
@@ -141,8 +141,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
|
||||
<select id="getAll" resultType="com.zg.project.system.domain.SysUser">
|
||||
select
|
||||
user_id as userId,
|
||||
dept_id as deptId,
|
||||
user_name as userName,
|
||||
nick_name as nickName,
|
||||
email,
|
||||
phonenumber,
|
||||
sex,
|
||||
avatar,
|
||||
password,
|
||||
status,
|
||||
del_flag as delFlag,
|
||||
login_ip as loginIp,
|
||||
login_date as loginDate,
|
||||
create_by as createBy,
|
||||
create_time as createTime,
|
||||
update_by as updateBy,
|
||||
update_time as updateTime,
|
||||
remark
|
||||
from sys_user
|
||||
where del_flag = '0'
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.wisdom.plan.mapper.GysJhMapper">
|
||||
<mapper namespace="com.zg.project.wisdom.mapper.GysJhMapper">
|
||||
|
||||
<resultMap type="GysJh" id="GysJhResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="indexNo" column="index_no" />
|
||||
<result property="xj" column="xj" />
|
||||
<result property="xmNo" column="xm_no" />
|
||||
<result property="xmMs" column="xm_ms" />
|
||||
@@ -20,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="jhQty" column="jh_qty" />
|
||||
<result property="htQty" column="ht_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -29,42 +31,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGysJhVo">
|
||||
select id, xj, xm_no, xm_ms, wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh, jh_qty, ht_qty, dw, remark, create_by, create_time, update_by, update_time, is_delete from gys_jh
|
||||
select id, index_no, xj, xm_no, xm_ms, wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh, jh_qty, ht_qty, dw, status, remark, create_by, create_time, update_by, update_time, is_delete from gys_jh
|
||||
</sql>
|
||||
|
||||
<select id="selectGysJhList" parameterType="GysJh" resultMap="GysJhResult">
|
||||
<include refid="selectGysJhVo"/>
|
||||
<where>
|
||||
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="gysNo != null and gysNo != ''"> and gys_no = #{gysNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="jhAmt != null "> and jh_amt = #{jhAmt}</if>
|
||||
<if test="htDj != null "> and ht_dj = #{htDj}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="xh != null and xh != ''"> and xh = #{xh}</if>
|
||||
<if test="jhQty != null "> and jh_qty = #{jhQty}</if>
|
||||
<if test="htQty != null "> and ht_qty = #{htQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<choose>
|
||||
<when test="isDelete != null and isDelete != ''">
|
||||
and is_delete = #{isDelete}
|
||||
</when>
|
||||
<otherwise>
|
||||
and is_delete = '0'
|
||||
</otherwise>
|
||||
</choose>
|
||||
<where>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no like concat('%', #{xmNo}, '%')</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no like concat('%', #{wlNo}, '%')</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc like concat('%', #{gysMc}, '%')</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no like concat('%', #{sapNo}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
|
||||
<!-- 排序逻辑 -->
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN update_time IS NOT NULL THEN update_time
|
||||
ELSE create_time
|
||||
END DESC
|
||||
</select>
|
||||
|
||||
<select id="selectGysJhById" parameterType="Long" resultMap="GysJhResult">
|
||||
@@ -72,13 +51,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectExistByKey" resultType="com.zg.project.wisdom.plan.domain.GysJh">
|
||||
select * from gys_jh where sap_no = #{sapNo} and xh = #{xh}
|
||||
<select id="getBySapNo" parameterType="java.lang.String" resultMap="GysJhResult">
|
||||
<include refid="selectGysJhVo"/>
|
||||
WHERE sap_no = #{sapNo}
|
||||
</select>
|
||||
|
||||
<insert id="insertGysJh" parameterType="GysJh" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into gys_jh
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="indexNo != null">index_no,</if>
|
||||
<if test="xj != null">xj,</if>
|
||||
<if test="xmNo != null">xm_no,</if>
|
||||
<if test="xmMs != null">xm_ms,</if>
|
||||
@@ -93,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jhQty != null">jh_qty,</if>
|
||||
<if test="htQty != null">ht_qty,</if>
|
||||
<if test="dw != null">dw,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@@ -101,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="indexNo != null">#{indexNo},</if>
|
||||
<if test="xj != null">#{xj},</if>
|
||||
<if test="xmNo != null">#{xmNo},</if>
|
||||
<if test="xmMs != null">#{xmMs},</if>
|
||||
@@ -115,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jhQty != null">#{jhQty},</if>
|
||||
<if test="htQty != null">#{htQty},</if>
|
||||
<if test="dw != null">#{dw},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@@ -127,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateGysJh" parameterType="GysJh">
|
||||
update gys_jh
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="indexNo != null">index_no = #{indexNo},</if>
|
||||
<if test="xj != null">xj = #{xj},</if>
|
||||
<if test="xmNo != null">xm_no = #{xmNo},</if>
|
||||
<if test="xmMs != null">xm_ms = #{xmMs},</if>
|
||||
@@ -141,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jhQty != null">jh_qty = #{jhQty},</if>
|
||||
<if test="htQty != null">ht_qty = #{htQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
@@ -156,9 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGysJhByIds" parameterType="String">
|
||||
update gys_jh
|
||||
set is_delete = '1'
|
||||
where id in
|
||||
delete from gys_jh where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
172
src/main/resources/mybatis/wisdom/RkInfoMapper.xml
Normal file
172
src/main/resources/mybatis/wisdom/RkInfoMapper.xml
Normal file
@@ -0,0 +1,172 @@
|
||||
<?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.wisdom.mapper.RkInfoMapper">
|
||||
|
||||
<resultMap type="RkInfo" id="RkInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="rkType" column="rk_type" />
|
||||
<result property="wlType" column="wl_type" />
|
||||
<result property="cangku" column="cangku" />
|
||||
<result property="rkTime" column="rk_time" />
|
||||
<result property="lihuoY" column="lihuo_y" />
|
||||
<result property="isChuku" column="is_chuku" />
|
||||
<result property="rkTypeName" column="rk_type_name"/>
|
||||
<result property="wlTypeName" column="wl_type_name"/>
|
||||
<result property="cangkuName" column="cangku_name"/>
|
||||
<result property="remark" column="remark" />
|
||||
<result property="xj" column="xj" />
|
||||
<result property="xmNo" column="xm_no" />
|
||||
<result property="xmMs" column="xm_ms" />
|
||||
<result property="wlNo" column="wl_no" />
|
||||
<result property="wlMs" column="wl_ms" />
|
||||
<result property="gysNo" column="gys_no" />
|
||||
<result property="gysMc" column="gys_mc" />
|
||||
<result property="jhAmt" column="jh_amt" />
|
||||
<result property="htDj" column="ht_dj" />
|
||||
<result property="sapNo" column="sap_no" />
|
||||
<result property="xh" column="xh" />
|
||||
<result property="jhQty" column="jh_qty" />
|
||||
<result property="htQty" column="ht_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="realQty" column="real_qty" />
|
||||
<result property="pcode" column="pcode" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="entityId" column="entity_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRkInfoVo">
|
||||
SELECT
|
||||
ri.id,
|
||||
ri.rk_type, st.type_name AS rk_type_name,
|
||||
ri.wl_type, mt.type_name AS wl_type_name,
|
||||
ri.cangku, wh.warehouse_name AS cangku_name,
|
||||
ri.rk_time, ri.lihuo_y, ri.is_chuku, ri.remark,
|
||||
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,
|
||||
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
|
||||
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,
|
||||
ri.pcode, ri.tray_code, ri.entity_id,
|
||||
ri.create_by, ri.create_time, ri.update_by, ri.update_time, ri.is_delete
|
||||
FROM rk_info ri
|
||||
LEFT JOIN stock_in_type st ON ri.rk_type = st.type_code
|
||||
LEFT JOIN material_type mt ON ri.wl_type = mt.type_code
|
||||
LEFT JOIN warehouse_info wh ON ri.cangku = wh.warehouse_code
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsertRkInfo" parameterType="java.util.List">
|
||||
insert into rk_info (
|
||||
rk_type, wl_type, cangku, lihuo_y, rk_time,
|
||||
wl_no, xm_ms, pcode, tray_code, real_qty, entity_id,
|
||||
remark, is_chuku, is_delete, create_by, create_time
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.rkType}, #{item.wlType}, #{item.cangku}, #{item.lihuoY}, #{item.rkTime},
|
||||
#{item.wlNo}, #{item.xmMs}, #{item.pcode}, #{item.trayCode}, #{item.realQty}, #{item.entityId},
|
||||
#{item.remark}, #{item.isChuku}, #{item.isDelete}, #{item.createBy}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectRkInfoList" parameterType="RkInfo" resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
<where>
|
||||
<if test="rkType != null and rkType != ''"> and rk_type = #{rkType}</if>
|
||||
<if test="wlType != null and wlType != ''"> and wl_type = #{wlType}</if>
|
||||
<if test="cangku != null and cangku != ''"> and cangku = #{cangku}</if>
|
||||
<if test="rkTime != null "> and rk_time = #{rkTime}</if>
|
||||
<if test="lihuoY != null and lihuoY != ''"> and lihuo_y = #{lihuoY}</if>
|
||||
<if test="isChuku != null and isChuku != ''"> and is_chuku = #{isChuku}</if>
|
||||
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="gysNo != null and gysNo != ''"> and gys_no = #{gysNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="jhAmt != null "> and jh_amt = #{jhAmt}</if>
|
||||
<if test="htDj != null "> and ht_dj = #{htDj}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="xh != null and xh != ''"> and xh = #{xh}</if>
|
||||
<if test="jhQty != null "> and jh_qty = #{jhQty}</if>
|
||||
<if test="htQty != null "> and ht_qty = #{htQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<if test="realQty != null "> and real_qty = #{realQty}</if>
|
||||
<if test="pcode != null and pcode != ''"> and pcode = #{pcode}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="entityId != null and entityId != ''"> and entity_id = #{entityId}</if>
|
||||
<if test="isDelete != null and isDelete != ''">
|
||||
and is_delete = #{isDelete}
|
||||
</if>
|
||||
<if test="isDelete == null or isDelete == ''">
|
||||
and is_delete = 0
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRkInfoById" parameterType="Long" resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
where id = #{id} and is_delete = 0
|
||||
</select>
|
||||
|
||||
<update id="updateRkInfo" parameterType="RkInfo">
|
||||
update rk_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="rkType != null">rk_type = #{rkType},</if>
|
||||
<if test="wlType != null">wl_type = #{wlType},</if>
|
||||
<if test="cangku != null">cangku = #{cangku},</if>
|
||||
<if test="rkTime != null">rk_time = #{rkTime},</if>
|
||||
<if test="lihuoY != null">lihuo_y = #{lihuoY},</if>
|
||||
<if test="isChuku != null">is_chuku = #{isChuku},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="xj != null">xj = #{xj},</if>
|
||||
<if test="xmNo != null">xm_no = #{xmNo},</if>
|
||||
<if test="xmMs != null">xm_ms = #{xmMs},</if>
|
||||
<if test="wlNo != null">wl_no = #{wlNo},</if>
|
||||
<if test="wlMs != null">wl_ms = #{wlMs},</if>
|
||||
<if test="gysNo != null">gys_no = #{gysNo},</if>
|
||||
<if test="gysMc != null">gys_mc = #{gysMc},</if>
|
||||
<if test="jhAmt != null">jh_amt = #{jhAmt},</if>
|
||||
<if test="htDj != null">ht_dj = #{htDj},</if>
|
||||
<if test="sapNo != null">sap_no = #{sapNo},</if>
|
||||
<if test="xh != null">xh = #{xh},</if>
|
||||
<if test="jhQty != null">jh_qty = #{jhQty},</if>
|
||||
<if test="htQty != null">ht_qty = #{htQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="realQty != null">real_qty = #{realQty},</if>
|
||||
<if test="pcode != null">pcode = #{pcode},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="entityId != null">entity_id = #{entityId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteRkInfoById" parameterType="Long">
|
||||
update rk_info
|
||||
set is_delete = 1
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteRkInfoByIds" parameterType="String">
|
||||
update rk_info
|
||||
set is_delete = 1
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user