106 lines
5.0 KiB
XML
106 lines
5.0 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.port.mapper.WcsPortMapper">
|
|
|
|
<resultMap type="WcsPort" id="WcsPortResult">
|
|
<result property="id" column="id" />
|
|
<result property="portCode" column="port_code" />
|
|
<result property="portName" column="port_name" />
|
|
<result property="portType" column="port_type" />
|
|
<result property="portRegion" column="port_region" />
|
|
<result property="spare1" column="spare1" />
|
|
<result property="spare2" column="spare2" />
|
|
<result property="spare3" column="spare3" />
|
|
<result property="spare4" column="spare4" />
|
|
<result property="spare5" column="spare5" />
|
|
<result property="status" column="status" />
|
|
</resultMap>
|
|
|
|
<sql id="selectWcsPortVo">
|
|
select id, port_code, port_name, port_type, port_region, spare1, spare2, spare3, status,spare4,spare5 from wcs_port
|
|
</sql>
|
|
|
|
<select id="selectWcsPortList" parameterType="WcsPort" resultMap="WcsPortResult">
|
|
<include refid="selectWcsPortVo"/>
|
|
<where>
|
|
<if test="portCode != null and portCode != ''"> and port_code = #{portCode}</if>
|
|
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
|
|
<if test="portType != null and portType != ''"> and port_type = #{portType}</if>
|
|
<if test="portRegion != null and portRegion != ''"> and port_region = #{portRegion}</if>
|
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
|
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
|
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
|
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectWcsPortById" parameterType="Long" resultMap="WcsPortResult">
|
|
<include refid="selectWcsPortVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectWcsPortByPortCode" resultMap="WcsPortResult">
|
|
<include refid="selectWcsPortVo"/>
|
|
where port_code = #{portCode}
|
|
</select>
|
|
|
|
<insert id="insertWcsPort" parameterType="WcsPort" useGeneratedKeys="true" keyProperty="id">
|
|
insert into wcs_port
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="portCode != null">port_code,</if>
|
|
<if test="portName != null">port_name,</if>
|
|
<if test="portType != null">port_type,</if>
|
|
<if test="portRegion != null">port_region,</if>
|
|
<if test="spare1 != null">spare1,</if>
|
|
<if test="spare2 != null">spare2,</if>
|
|
<if test="spare3 != null">spare3,</if>
|
|
<if test="spare4 != null">spare4,</if>
|
|
<if test="spare5 != null">spare5,</if>
|
|
<if test="status != null">status,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="portCode != null">#{portCode},</if>
|
|
<if test="portName != null">#{portName},</if>
|
|
<if test="portType != null">#{portType},</if>
|
|
<if test="portRegion != null">#{portRegion},</if>
|
|
<if test="spare1 != null">#{spare1},</if>
|
|
<if test="spare2 != null">#{spare2},</if>
|
|
<if test="spare3 != null">#{spare3},</if>
|
|
<if test="spare4 != null">#{spare4},</if>
|
|
<if test="spare5 != null">#{spare5},</if>
|
|
<if test="status != null">#{status},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateWcsPort" parameterType="WcsPort">
|
|
update wcs_port
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="portCode != null">port_code = #{portCode},</if>
|
|
<if test="portName != null">port_name = #{portName},</if>
|
|
<if test="portType != null">port_type = #{portType},</if>
|
|
<if test="portRegion != null">port_region = #{portRegion},</if>
|
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
|
<if test="spare4 != null">spare4 = #{spare4},</if>
|
|
<if test="spare5 != null">spare5 = #{spare5},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteWcsPortById" parameterType="Long">
|
|
delete from wcs_port where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteWcsPortByIds" parameterType="String">
|
|
delete from wcs_port where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|