131 lines
8.5 KiB
XML
131 lines
8.5 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.EmisTmsTransPlanDtlMapper">
|
|
|
|
<resultMap type="EmisTmsTransPlanDtl" id="EmisTmsTransPlanDtlResult">
|
|
<result property="id" column="id" />
|
|
<result property="planId" column="plan_id" />
|
|
<result property="startSiteCode" column="start_site_code" />
|
|
<result property="destSiteCode" column="dest_site_code" />
|
|
<result property="transType" column="trans_type" />
|
|
<result property="estCostDay" column="est_cost_day" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="status" column="status" />
|
|
<result property="createSiteCode" column="create_site_code" />
|
|
<result property="modifySiteCode" column="modify_site_code" />
|
|
<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" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisTmsTransPlanDtlVo">
|
|
select id, plan_id, start_site_code, dest_site_code, trans_type, est_cost_day, order_num, status, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark from emis_tms_trans_plan_dtl
|
|
</sql>
|
|
|
|
<select id="selectEmisTmsTransPlanDtlList" parameterType="EmisTmsTransPlanDtl" resultMap="EmisTmsTransPlanDtlResult">
|
|
<include refid="selectEmisTmsTransPlanDtlVo"/>
|
|
<where>
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="planId != null "> and plan_id = #{planId}</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''"> and start_site_code like concat('%', #{startSiteCode}, '%')</if>
|
|
<if test="destSiteCode != null and destSiteCode != ''"> and dest_site_code like concat('%', #{destSiteCode}, '%')</if>
|
|
<if test="transType != null and transType != ''"> and trans_type like concat('%', #{transType}, '%')</if>
|
|
<if test="estCostDay != null and estCostDay != ''"> and est_cost_day like concat('%', #{estCostDay}, '%')</if>
|
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
|
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
|
|
<if test="createSiteCode != null and createSiteCode != ''"> and create_site_code like concat('%', #{createSiteCode}, '%')</if>
|
|
<if test="modifySiteCode != null and modifySiteCode != ''"> and modify_site_code like concat('%', #{modifySiteCode}, '%')</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="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectEmisTmsTransPlanDtlById" parameterType="Long" resultMap="EmisTmsTransPlanDtlResult">
|
|
select id, plan_id, start_site_code, dest_site_code, trans_type, est_cost_day, order_num, status, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark
|
|
from emis_tms_trans_plan_dtl a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisTmsTransPlanDtl" parameterType="EmisTmsTransPlanDtl">
|
|
insert into emis_tms_trans_plan_dtl
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="planId != null">plan_id,</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">start_site_code,</if>
|
|
<if test="destSiteCode != null and destSiteCode != ''">dest_site_code,</if>
|
|
<if test="transType != null and transType != ''">trans_type,</if>
|
|
<if test="estCostDay != null and estCostDay != ''">est_cost_day,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="createSiteCode != null and createSiteCode != ''">create_site_code,</if>
|
|
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code,</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="remark != null and remark != ''">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="planId != null">#{planId},</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">#{startSiteCode},</if>
|
|
<if test="destSiteCode != null and destSiteCode != ''">#{destSiteCode},</if>
|
|
<if test="transType != null and transType != ''">#{transType},</if>
|
|
<if test="estCostDay != null and estCostDay != ''">#{estCostDay},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="createSiteCode != null and createSiteCode != ''">#{createSiteCode},</if>
|
|
<if test="modifySiteCode != null and modifySiteCode != ''">#{modifySiteCode},</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="remark != null and remark != ''">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisTmsTransPlanDtl" parameterType="EmisTmsTransPlanDtl">
|
|
update emis_tms_trans_plan_dtl
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="planId != null">plan_id = #{planId},</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">start_site_code = #{startSiteCode},</if>
|
|
<if test="destSiteCode != null and destSiteCode != ''">dest_site_code = #{destSiteCode},</if>
|
|
<if test="transType != null and transType != ''">trans_type = #{transType},</if>
|
|
<if test="estCostDay != null and estCostDay != ''">est_cost_day = #{estCostDay},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="createSiteCode != null and createSiteCode != ''">create_site_code = #{createSiteCode},</if>
|
|
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code = #{modifySiteCode},</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="remark != null and remark != ''">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisTmsTransPlanDtlById" parameterType="Long">
|
|
delete from emis_tms_trans_plan_dtl where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisTmsTransPlanDtlByIds" parameterType="String">
|
|
delete from emis_tms_trans_plan_dtl where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |