105 lines
5.3 KiB
XML
105 lines
5.3 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.container.mapper.BasContainerMapper">
|
|
|
|
<resultMap type="BasContainer" id="BasContainerResult">
|
|
<result property="containerId" column="container_id" />
|
|
<result property="portName" column="port_name" />
|
|
<result property="status" column="status" />
|
|
<result property="productTypeQuantity" column="product_type_quantity" />
|
|
<result property="capacity" column="capacity" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="operationMan" column="operation_man" />
|
|
<result property="spare1" column="spare1" />
|
|
<result property="spare2" column="spare2" />
|
|
<result property="spare3" column="spare3" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBasContainerVo">
|
|
select container_id, port_name, status, product_type_quantity, capacity, create_time, update_time, operation_man, spare1, spare2, spare3 from bas_container
|
|
</sql>
|
|
|
|
<select id="selectBasContainerList" parameterType="BasContainer" resultMap="BasContainerResult">
|
|
<include refid="selectBasContainerVo"/>
|
|
<where>
|
|
<if test="containerId != null and containerId != ''"> and container_id like concat('%', #{containerId}, '%')</if>
|
|
<if test="portName != null and portName != ''"> and port_name = #{portName}</if>
|
|
<if test="status != null "> and status = #{status}</if>
|
|
<if test="productTypeQuantity != null "> and product_type_quantity = #{productTypeQuantity}</if>
|
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime}</if>
|
|
<if test="operationMan != null and operationMan != ''"> and operation_man = #{operationMan}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBasContainerByContainerId" parameterType="String" resultMap="BasContainerResult">
|
|
<include refid="selectBasContainerVo"/>
|
|
where container_id = #{containerId}
|
|
</select>
|
|
|
|
<insert id="insertBasContainer" parameterType="BasContainer">
|
|
insert into bas_container
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="containerId != null">container_id,</if>
|
|
<if test="portName != null">port_name,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="productTypeQuantity != null">product_type_quantity,</if>
|
|
<if test="capacity != null">capacity,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<!-- <if test="updateTime != null">update_time,</if>-->
|
|
update_time,
|
|
<if test="operationMan != null">operation_man,</if>
|
|
<if test="spare1 != null">spare1,</if>
|
|
<if test="spare2 != null">spare2,</if>
|
|
<if test="spare3 != null">spare3,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="containerId != null">#{containerId},</if>
|
|
<if test="portName != null">#{portName},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="productTypeQuantity != null">#{productTypeQuantity},</if>
|
|
<if test="capacity != null">#{capacity},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
|
GETDATE(),
|
|
<if test="operationMan != null">#{operationMan},</if>
|
|
<if test="spare1 != null">#{spare1},</if>
|
|
<if test="spare2 != null">#{spare2},</if>
|
|
<if test="spare3 != null">#{spare3},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBasContainer" parameterType="BasContainer">
|
|
update bas_container
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="portName != null">port_name = #{portName},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="productTypeQuantity != null">product_type_quantity = #{productTypeQuantity},</if>
|
|
<if test="capacity != null">capacity = #{capacity},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateTime != null">update_time = GETDATE(),</if>
|
|
<if test="operationMan != null">operation_man = #{operationMan},</if>
|
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
|
</trim>
|
|
where container_id = #{containerId}
|
|
</update>
|
|
|
|
<delete id="deleteBasContainerByContainerId" parameterType="String">
|
|
delete from bas_container where container_id = #{containerId}
|
|
</delete>
|
|
|
|
<delete id="deleteBasContainerByContainerIds" parameterType="String">
|
|
delete from bas_container where container_id in
|
|
<foreach item="containerId" collection="array" open="(" separator="," close=")">
|
|
#{containerId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectPortNames" resultType="string">
|
|
SELECT DISTINCT port_name FROM bas_product_port WHERE port_name != null or port_name != ''
|
|
</select>
|
|
</mapper> |