新增入库模块
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.shzg.project.unique.mapper.WornUniqueCodeMapper">
|
||||
|
||||
|
||||
<resultMap type="WornUniqueCode" id="WornUniqueCodeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="code" column="code" />
|
||||
@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornUniqueCodeVo">
|
||||
select id, code, bill_no, project_id, status, rfid_code, print_count, create_by, create_time, update_by, update_time, remark, is_delete from worn_unique_code
|
||||
select id, code, bill_no, project_id, status, rfid_code, print_count, create_by, create_time, update_by, update_time, remark, is_delete
|
||||
from worn_unique_code
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeList" parameterType="WornUniqueCode" resultMap="WornUniqueCodeResult">
|
||||
@@ -29,19 +30,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM worn_unique_code t
|
||||
LEFT JOIN sys_dept d ON t.project_id = d.dept_id
|
||||
<where>
|
||||
<if test="code != null"> and t.code = #{code}</if>
|
||||
<if test="billNo != null and billNo != ''"> and t.bill_no = #{billNo}</if>
|
||||
<if test="projectId != null "> and t.project_id = #{projectId}</if>
|
||||
<if test="status != null and status != ''"> and t.status = #{status}</if>
|
||||
<if test="rfidCode != null and rfidCode != ''"> and t.rfid_code = #{rfidCode}</if>
|
||||
|
||||
${params.dataScope}
|
||||
|
||||
<if test="code != null and code != ''">
|
||||
AND t.code = #{code}
|
||||
</if>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND t.bill_no = #{billNo}
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
AND t.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND t.status = #{status}
|
||||
</if>
|
||||
<if test="rfidCode != null and rfidCode != ''">
|
||||
AND t.rfid_code = #{rfidCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectWornUniqueCodeById" parameterType="Long" resultMap="WornUniqueCodeResult">
|
||||
<include refid="selectWornUniqueCodeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectIdByCode" resultType="java.lang.Long">
|
||||
select id
|
||||
from worn_unique_code
|
||||
where code = #{code}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornUniqueCode" parameterType="WornUniqueCode" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_unique_code
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -57,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="billNo != null">#{billNo},</if>
|
||||
@@ -71,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornUniqueCode" parameterType="WornUniqueCode">
|
||||
@@ -93,6 +113,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByCode" parameterType="WornUniqueCode">
|
||||
update worn_unique_code
|
||||
set status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime}
|
||||
where code = #{code}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeByIds" parameterType="Long">
|
||||
delete from worn_unique_code where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
|
||||
116
src/main/resources/mybatis/worn/WornInboundBillMapper.xml
Normal file
116
src/main/resources/mybatis/worn/WornInboundBillMapper.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?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.shzg.project.worn.mapper.WornInboundBillMapper">
|
||||
|
||||
<resultMap type="WornInboundBill" id="WornInboundBillResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="billType" column="bill_type" />
|
||||
<result property="warehouseCode" column="warehouse_code" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="inboundTime" column="inbound_time" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornInboundBillVo">
|
||||
select id, bill_no, bill_type, warehouse_code, warehouse_name, area_code, area_name, remark, inbound_time, status, is_delete, create_by, create_time, update_by, update_time from worn_inbound_bill
|
||||
</sql>
|
||||
|
||||
<select id="selectWornInboundBillList" parameterType="WornInboundBill" resultMap="WornInboundBillResult">
|
||||
<include refid="selectWornInboundBillVo"/>
|
||||
<where>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="billType != null and billType != ''"> and bill_type = #{billType}</if>
|
||||
<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="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="inboundTime != null "> and inbound_time = #{inboundTime}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornInboundBillById" parameterType="Long" resultMap="WornInboundBillResult">
|
||||
<include refid="selectWornInboundBillVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornInboundBill" parameterType="WornInboundBill" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_inbound_bill
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">bill_no,</if>
|
||||
<if test="billType != null">bill_type,</if>
|
||||
<if test="warehouseCode != null">warehouse_code,</if>
|
||||
<if test="warehouseName != null">warehouse_name,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="inboundTime != null">inbound_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">#{billNo},</if>
|
||||
<if test="billType != null">#{billType},</if>
|
||||
<if test="warehouseCode != null">#{warehouseCode},</if>
|
||||
<if test="warehouseName != null">#{warehouseName},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="inboundTime != null">#{inboundTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornInboundBill" parameterType="WornInboundBill">
|
||||
update worn_inbound_bill
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
|
||||
<if test="billType != null">bill_type = #{billType},</if>
|
||||
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
|
||||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="inboundTime != null">inbound_time = #{inboundTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornInboundBillById" parameterType="Long">
|
||||
delete from worn_inbound_bill where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornInboundBillByIds" parameterType="String">
|
||||
delete from worn_inbound_bill where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
88
src/main/resources/mybatis/worn/WornInboundItemMapper.xml
Normal file
88
src/main/resources/mybatis/worn/WornInboundItemMapper.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<?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.shzg.project.worn.mapper.WornInboundItemMapper">
|
||||
|
||||
<resultMap type="WornInboundItem" id="WornInboundItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billId" column="bill_id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="uniqueCode" column="unique_code" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornInboundItemVo">
|
||||
select id, bill_id, bill_no, material_id, quantity, unique_code, remark, create_by, create_time from worn_inbound_item
|
||||
</sql>
|
||||
|
||||
<select id="selectWornInboundItemList" parameterType="WornInboundItem" resultMap="WornInboundItemResult">
|
||||
<include refid="selectWornInboundItemVo"/>
|
||||
<where>
|
||||
<if test="billId != null "> and bill_id = #{billId}</if>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="uniqueCode != null"> and unique_code = #{uniqueCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornInboundItemById" parameterType="Long" resultMap="WornInboundItemResult">
|
||||
<include refid="selectWornInboundItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornInboundItem" parameterType="WornInboundItem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_inbound_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="billId != null">bill_id,</if>
|
||||
<if test="billNo != null">bill_no,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="uniqueCode != null">unique_code,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billId != null">#{billId},</if>
|
||||
<if test="billNo != null">#{billNo},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="uniqueCode != null">#{uniqueCode},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornInboundItem" parameterType="WornInboundItem">
|
||||
update worn_inbound_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="billId != null">bill_id = #{billId},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="uniqueCode != null">unique_code = #{uniqueCode},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornInboundItemById" parameterType="Long">
|
||||
delete from worn_inbound_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornInboundItemByIds" parameterType="String">
|
||||
delete from worn_inbound_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -91,6 +91,20 @@
|
||||
|
||||
<where>
|
||||
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
wm.material_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.material_short_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.material_code LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.specification LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.model LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.barcode LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR wm.description LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR t.type_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR u.unit_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="materialName != null and materialName != ''">
|
||||
AND wm.material_name LIKE CONCAT('%',#{materialName},'%')
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user