151 lines
8.7 KiB
XML
151 lines
8.7 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.emis.mapper.EmisTmsSiteBatchLoadingMapper">
|
|
|
|
<resultMap type="EmisTmsSiteBatchLoading" id="EmisTmsSiteBatchLoadingResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="batchNo" column="batch_no" />
|
|
<result property="posNo" column="pos_no" />
|
|
<result property="row" column="row" />
|
|
<result property="col" column="col" />
|
|
<result property="layer" column="layer" />
|
|
<result property="posDesc" column="pos_desc" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisTmsSiteBatchLoadingVo">
|
|
select id, batch_no, pos_no, row, col, layer, pos_desc, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_site_batch_loading
|
|
</sql>
|
|
|
|
<select id="selectEmisTmsSiteBatchLoadingList" parameterType="EmisTmsSiteBatchLoading" resultMap="EmisTmsSiteBatchLoadingResult">
|
|
<include refid="selectEmisTmsSiteBatchLoadingVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
|
|
<if test="posNo != null and posNo != ''"> and pos_no like concat('%', #{posNo}, '%')</if>
|
|
<if test="row != null and row != ''"> and row like concat('%', #{row}, '%')</if>
|
|
<if test="col != null and col != ''"> and col like concat('%', #{col}, '%')</if>
|
|
<if test="layer != null and layer != ''"> and layer like concat('%', #{layer}, '%')</if>
|
|
<if test="posDesc != null and posDesc != ''"> and pos_desc like concat('%', #{posDesc}, '%')</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>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectEmisTmsSiteBatchLoadingByBatchNo" parameterType="String" resultMap="EmisTmsSiteBatchLoadingResult">
|
|
<include refid="selectEmisTmsSiteBatchLoadingVo"/>
|
|
where del_flag='0' and batch_no = #{batchNo}
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisTmsSiteBatchLoading" resultType="int">
|
|
select count(1) from emis_tms_site_batch_loading
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and batch_no = #{batchNo}
|
|
and pos_no = #{posNo}
|
|
and row = #{row}
|
|
and col = #{col}
|
|
and layer = #{layer}
|
|
and pos_desc = #{posDesc}
|
|
and remark = #{remark}
|
|
and tenant_id = #{tenantId}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisTmsSiteBatchLoadingById" parameterType="Long" resultMap="EmisTmsSiteBatchLoadingResult">
|
|
select id, batch_no, pos_no, row, col, layer, pos_desc, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_tms_site_batch_loading a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisTmsSiteBatchLoading" parameterType="EmisTmsSiteBatchLoading" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_tms_site_batch_loading
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="batchNo != null and batchNo != ''">batch_no,</if>
|
|
<if test="posNo != null and posNo != ''">pos_no,</if>
|
|
<if test="row != null and row != ''">row,</if>
|
|
<if test="col != null and col != ''">col,</if>
|
|
<if test="layer != null and layer != ''">layer,</if>
|
|
<if test="posDesc != null and posDesc != ''">pos_desc,</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>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="batchNo != null and batchNo != ''">#{batchNo},</if>
|
|
<if test="posNo != null and posNo != ''">#{posNo},</if>
|
|
<if test="row != null and row != ''">#{row},</if>
|
|
<if test="col != null and col != ''">#{col},</if>
|
|
<if test="layer != null and layer != ''">#{layer},</if>
|
|
<if test="posDesc != null and posDesc != ''">#{posDesc},</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>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisTmsSiteBatchLoading" parameterType="EmisTmsSiteBatchLoading">
|
|
update emis_tms_site_batch_loading
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="batchNo != null and batchNo != ''">batch_no = #{batchNo},</if>
|
|
<if test="posNo != null and posNo != ''">pos_no = #{posNo},</if>
|
|
<if test="row != null and row != ''">row = #{row},</if>
|
|
<if test="col != null and col != ''">col = #{col},</if>
|
|
<if test="layer != null and layer != ''">layer = #{layer},</if>
|
|
<if test="posDesc != null and posDesc != ''">pos_desc = #{posDesc},</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>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisTmsSiteBatchLoadingById" parameterType="Long">
|
|
delete from emis_tms_site_batch_loading where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisTmsSiteBatchLoadingByIds" parameterType="String">
|
|
delete from emis_tms_site_batch_loading where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |