唯一码模块开发2.0包含事件、物料和数据隔离
This commit is contained in:
112
src/main/resources/mybatis/unique/WornUniqueCodeEventMapper.xml
Normal file
112
src/main/resources/mybatis/unique/WornUniqueCodeEventMapper.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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.unique.mapper.WornUniqueCodeEventMapper">
|
||||
|
||||
<resultMap type="WornUniqueCodeEvent" id="WornUniqueCodeEventResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="uniqueCodeId" column="unique_code_id" />
|
||||
<result property="eventType" column="event_type" />
|
||||
<result property="eventStatus" column="event_status" />
|
||||
<result property="eventDesc" column="event_desc" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operatorName" column="operator_name" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornUniqueCodeEventVo">
|
||||
select id, unique_code_id, event_type, event_status, event_desc, operator_id, operator_name, create_by, create_time, update_by, update_time, remark, is_delete from worn_unique_code_event
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeEventList" parameterType="WornUniqueCodeEvent" resultMap="WornUniqueCodeEventResult">
|
||||
<include refid="selectWornUniqueCodeEventVo"/>
|
||||
<where>
|
||||
<if test="uniqueCodeId != null "> and unique_code_id = #{uniqueCodeId}</if>
|
||||
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
|
||||
<if test="eventStatus != null and eventStatus != ''"> and event_status = #{eventStatus}</if>
|
||||
<if test="eventDesc != null and eventDesc != ''"> and event_desc = #{eventDesc}</if>
|
||||
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
|
||||
<if test="operatorName != null and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornUniqueCodeEventById" parameterType="Long" resultMap="WornUniqueCodeEventResult">
|
||||
<include refid="selectWornUniqueCodeEventVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWornUniqueCodeEvent" parameterType="WornUniqueCodeEvent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_unique_code_event
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id,</if>
|
||||
<if test="eventType != null and eventType != ''">event_type,</if>
|
||||
<if test="eventStatus != null">event_status,</if>
|
||||
<if test="eventDesc != null">event_desc,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorName != null">operator_name,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">#{uniqueCodeId},</if>
|
||||
<if test="eventType != null and eventType != ''">#{eventType},</if>
|
||||
<if test="eventStatus != null">#{eventStatus},</if>
|
||||
<if test="eventDesc != null">#{eventDesc},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorName != null">#{operatorName},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornUniqueCodeEvent" parameterType="WornUniqueCodeEvent">
|
||||
update worn_unique_code_event
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id = #{uniqueCodeId},</if>
|
||||
<if test="eventType != null and eventType != ''">event_type = #{eventType},</if>
|
||||
<if test="eventStatus != null">event_status = #{eventStatus},</if>
|
||||
<if test="eventDesc != null">event_desc = #{eventDesc},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorName != null">operator_name = #{operatorName},</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="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeEventById" parameterType="Long">
|
||||
delete from worn_unique_code_event where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeEventByIds" parameterType="String">
|
||||
delete from worn_unique_code_event where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByUniqueCodeId" resultType="WornUniqueCodeMaterial">
|
||||
SELECT *
|
||||
FROM worn_unique_code_material
|
||||
WHERE unique_code_id = #{uniqueCodeId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,15 +25,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeList" parameterType="WornUniqueCode" resultMap="WornUniqueCodeResult">
|
||||
<include refid="selectWornUniqueCodeVo"/>
|
||||
<where>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="rfidCode != null and rfidCode != ''"> and rfid_code = #{rfidCode}</if>
|
||||
<if test="printCount != null "> and print_count = #{printCount}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
SELECT t.*
|
||||
FROM worn_unique_code t
|
||||
LEFT JOIN sys_dept d ON t.project_id = d.dept_id
|
||||
<where>
|
||||
<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>
|
||||
|
||||
@@ -93,9 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeById" parameterType="Long">
|
||||
delete from worn_unique_code where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeByIds" parameterType="String">
|
||||
delete from worn_unique_code where id in
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.unique.mapper.WornUniqueCodeMaterialMapper">
|
||||
|
||||
<resultMap type="WornUniqueCodeMaterial" id="WornUniqueCodeMaterialResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="uniqueCodeId" column="unique_code_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWornUniqueCodeMaterialVo">
|
||||
select id, unique_code_id, material_id, unit_id, quantity, create_by, create_time, update_by, update_time, remark, is_delete from worn_unique_code_material
|
||||
</sql>
|
||||
|
||||
<select id="selectWornUniqueCodeMaterialList" parameterType="WornUniqueCodeMaterial" resultMap="WornUniqueCodeMaterialResult">
|
||||
<include refid="selectWornUniqueCodeMaterialVo"/>
|
||||
<where>
|
||||
<if test="uniqueCodeId != null "> and unique_code_id = #{uniqueCodeId}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWornUniqueCodeMaterialById" parameterType="Long" resultMap="WornUniqueCodeMaterialResult">
|
||||
<include refid="selectWornUniqueCodeMaterialVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<insert id="insertWornUniqueCodeMaterial" parameterType="WornUniqueCodeMaterial" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into worn_unique_code_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="quantity != null">quantity,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">#{uniqueCodeId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="quantity != null">#{quantity},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWornUniqueCodeMaterial" parameterType="WornUniqueCodeMaterial">
|
||||
update worn_unique_code_material
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="uniqueCodeId != null">unique_code_id = #{uniqueCodeId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</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="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWornUniqueCodeMaterialById" parameterType="Long">
|
||||
delete from worn_unique_code_material where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWornUniqueCodeMaterialByIds" parameterType="String">
|
||||
delete from worn_unique_code_material where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectByUniqueCodeId" resultType="com.shzg.project.unique.domain.WornUniqueCodeMaterial">
|
||||
SELECT *
|
||||
FROM worn_unique_code_material
|
||||
WHERE unique_code_id = #{uniqueCodeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user