101 lines
5.1 KiB
XML
101 lines
5.1 KiB
XML
|
|
<?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>
|