emis-service/emis-wms/src/main/resources/mapper/WmsPlatformMapper.xml
2024-01-11 16:46:48 +08:00

111 lines
6.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.xdadan.erp.wms.mapper.WmsPlatformMapper">
<resultMap type="WmsPlatform" id="WmsPlatformResult">
<result property="id" column="id" />
<result property="platformCode" column="platform_code" />
<result property="platformName" column="platform_name" />
<result property="warehouseId" column="warehouse_id" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmsPlatformVo">
select id, platform_code, platform_name, warehouse_id, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time from wms_platform
</sql>
<select id="selectWmsPlatformList" parameterType="WmsPlatform" resultMap="WmsPlatformResult">
<include refid="selectWmsPlatformVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="platformCode != null and platformCode != ''"> and platform_code like concat('%', #{platformCode}, '%')</if>
<if test="platformName != null and platformName != ''"> and platform_name like concat('%', #{platformName}, '%')</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="status != null "> and status = #{status}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
order by create_time desc
</select>
<select id="selectWmsPlatformById" parameterType="Integer" resultMap="WmsPlatformResult">
select id, platform_code, platform_name, warehouse_id, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time
from wms_platform a
where a.id = #{id}
</select>
<insert id="insertWmsPlatform" parameterType="WmsPlatform">
insert into wms_platform
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="platformCode != null and platformCode != ''">platform_code,</if>
<if test="platformName != null and platformName != ''">platform_name,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="platformCode != null and platformCode != ''">#{platformCode},</if>
<if test="platformName != null and platformName != ''">#{platformName},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsPlatform" parameterType="WmsPlatform">
update wms_platform
<trim prefix="SET" suffixOverrides=",">
<if test="platformCode != null and platformCode != ''">platform_code = #{platformCode},</if>
<if test="platformName != null and platformName != ''">platform_name = #{platformName},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWmsPlatformById" parameterType="Integer">
delete from wms_platform where id = #{id}
</delete>
<delete id="deleteWmsPlatformByIds" parameterType="String">
delete from wms_platform where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>