92 lines
4.4 KiB
XML
92 lines
4.4 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.ruoyi.bas.fluent.mapper.BasFluentFrameMapper">
|
|
|
|
<resultMap type="BasFluentFrame" id="BasFluentFrameResult">
|
|
<result property="id" column="id" />
|
|
<result property="locationName" column="location_name" />
|
|
<result property="type" column="type" />
|
|
<result property="frameId" column="frame_id" />
|
|
<result property="boxNum" column="box_num" />
|
|
<result property="trayCode" column="tray_code" />
|
|
<result property="groupId" column="group_id" />
|
|
<result property="allotNum" column="allot_num" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBasFluentFrameVo">
|
|
select id, location_name, type, frame_id, box_num, tray_code, group_id, allot_num from bas_fluent_frame
|
|
</sql>
|
|
|
|
<select id="selectBasFluentFrameList" parameterType="BasFluentFrame" resultMap="BasFluentFrameResult">
|
|
<include refid="selectBasFluentFrameVo"/>
|
|
<where>
|
|
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
<if test="frameId != null and frameId != ''"> and frame_id = #{frameId}</if>
|
|
<if test="boxNum != null "> and box_num = #{boxNum}</if>
|
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
|
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
|
<if test="allotNum != null "> and allot_num = #{allotNum}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBasFluentFrameById" parameterType="Long" resultMap="BasFluentFrameResult">
|
|
<include refid="selectBasFluentFrameVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectBasFluentFrameOrderByAllotNum" resultMap="BasFluentFrameResult">
|
|
select TOP 1 id, location_name, type, frame_id, box_num, tray_code, group_id, allot_num from bas_fluent_frame
|
|
where frame_id = #{frameId} and type = '1' and allot_num = 0
|
|
order by order_num asc
|
|
</select>
|
|
|
|
<insert id="insertBasFluentFrame" parameterType="BasFluentFrame" useGeneratedKeys="true" keyProperty="id">
|
|
insert into bas_fluent_frame
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="locationName != null">location_name,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="frameId != null">frame_id,</if>
|
|
<if test="boxNum != null">box_num,</if>
|
|
<if test="trayCode != null">tray_code,</if>
|
|
<if test="groupId != null">group_id,</if>
|
|
<if test="allotNum != null">allot_num,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="locationName != null">#{locationName},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="frameId != null">#{frameId},</if>
|
|
<if test="boxNum != null">#{boxNum},</if>
|
|
<if test="trayCode != null">#{trayCode},</if>
|
|
<if test="groupId != null">#{groupId},</if>
|
|
<if test="allotNum != null">#{allotNum},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBasFluentFrame" parameterType="BasFluentFrame">
|
|
update bas_fluent_frame
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="locationName != null">location_name = #{locationName},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="frameId != null">frame_id = #{frameId},</if>
|
|
<if test="boxNum != null">box_num = #{boxNum},</if>
|
|
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
|
<if test="groupId != null">group_id = #{groupId},</if>
|
|
<if test="allotNum != null">allot_num = #{allotNum},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBasFluentFrameById" parameterType="Long">
|
|
delete from bas_fluent_frame where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteBasFluentFrameByIds" parameterType="String">
|
|
delete from bas_fluent_frame where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|