93 lines
4.8 KiB
XML
Raw Normal View History

2025-10-11 19:30:04 +08:00
<?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.shgx.system.mapper.mold.MoldWarehouseLocationLiveMapper">
<resultMap type="MoldWarehouseLocationLive" id="MoldWarehouseLocationLiveResult">
<result property="id" column="id" />
<result property="moldCode" column="mold_code" />
<result property="moldName" column="mold_name" />
<result property="positionCode" column="position_code" />
<result property="status" column="status" />
<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" />
</resultMap>
<sql id="selectMoldWarehouseLocationLiveVo">
select id, mold_code, mold_name, position_code, status, create_by, create_time, update_by, update_time, remark from mold_warehouse_location_live
</sql>
<select id="selectMoldWarehouseLocationLiveList" parameterType="MoldWarehouseLocationLive" resultMap="MoldWarehouseLocationLiveResult">
<include refid="selectMoldWarehouseLocationLiveVo"/>
<where>
<if test="moldCode != null and moldCode != ''"> and mold_code = #{moldCode}</if>
<if test="moldName != null and moldName != ''"> and mold_name like concat('%', #{moldName}, '%')</if>
<if test="positionCode != null and positionCode != ''"> and position_code = #{positionCode}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectMoldWarehouseLocationLiveById" parameterType="Long" resultMap="MoldWarehouseLocationLiveResult">
<include refid="selectMoldWarehouseLocationLiveVo"/>
where id = #{id}
</select>
<insert id="insertMoldWarehouseLocationLive" parameterType="MoldWarehouseLocationLive">
insert into mold_warehouse_location_live
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="moldCode != null">mold_code,</if>
<if test="moldName != null and moldName != ''">mold_name,</if>
<if test="positionCode != null">position_code,</if>
<if test="status != null and status != ''">status,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="moldCode != null">#{moldCode},</if>
<if test="moldName != null and moldName != ''">#{moldName},</if>
<if test="positionCode != null">#{positionCode},</if>
<if test="status != null and status != ''">#{status},</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>
</trim>
</insert>
<update id="updateMoldWarehouseLocationLive" parameterType="MoldWarehouseLocationLive">
update mold_warehouse_location_live
<trim prefix="SET" suffixOverrides=",">
<if test="moldCode != null">mold_code = #{moldCode},</if>
<if test="moldName != null and moldName != ''">mold_name = #{moldName},</if>
<if test="positionCode != null">position_code = #{positionCode},</if>
<if test="status != null and status != ''">status = #{status},</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>
</trim>
where id = #{id}
</update>
<delete id="deleteMoldWarehouseLocationLiveById" parameterType="Long">
delete from mold_warehouse_location_live where id = #{id}
</delete>
<delete id="deleteMoldWarehouseLocationLiveByIds" parameterType="String">
delete from mold_warehouse_location_live where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>