<?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.buss.mapper.DsMatDispatchMapper2">
|
|
<resultMap type="DsMatDispatch2" id="DsMatDispatchResult">
|
<result property="id" column="ID" />
|
<result property="resHarborId" column="RES_HARBOR_ID" />
|
<result property="resHarborName" column="RES_HARBOR_NAME" />
|
<result property="desHarborId" column="DES_HARBOR_ID" />
|
<result property="desHarborName" column="DES_HARBOR_NAME" />
|
<result property="content" column="CONTENT" />
|
<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" />
|
<result property="status" column="STATUS" />
|
<result property="applyBy" column="APPLY_BY" />
|
<result property="applyTime" column="APPLY_TIME" />
|
<result property="applyResult" column="APPLY_RESULT" />
|
<result property="applyContent" column="APPLY_CONTENT" />
|
</resultMap>
|
|
<sql id="selectDsMatDispatchVo">
|
select ID,RES_HARBOR_ID,RES_HARBOR_NAME,DES_HARBOR_ID,DES_HARBOR_NAME,CONTENT,DEL_FLAG,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME,REMARK,STATUS,APPLY_BY,APPLY_TIME,APPLY_RESULT, APPLY_CONTENT from DS_MAT_DISPATCH
|
</sql>
|
|
<select id="selectDsMatDispatchList" parameterType="DsMatDispatch2" resultMap="DsMatDispatchResult">
|
<include refid="selectDsMatDispatchVo" />
|
<where>
|
<if test="id != null and id != ''"> and ID = #{ID}</if>
|
<if test="resHarborId != null and resHarborId != ''"> and RES_HARBOR_ID = #{resHarborId} </if>
|
<if test="resHarborName != null and resHarborName != ''"> and RES_HARBOR_NAME = #{resHarborName}</if>
|
<if test="desHarborId != null and desHarborId != ''"> and DES_HARBOR_ID = #{desHarborId} </if>
|
<if test="desHarborName != null and desHarborName != ''"> and DES_HARBOR_NAME = #{desHarborName} </if>
|
<if test="content != null and content != ''"> and CONTENT like concat('%', #{content}, '%') </if>
|
<if test="status != null and status != ''"> and STATUS = #{status} </if>
|
<if test="applyBy != null and applyBy != '' "> and APPLY_BY = #{applyBy} </if>
|
<if test="applyTime != null and applyTime != ''"> and APPLY_TIME = #{applyTime} </if>
|
<if test="applyResult != null and applyResult != '' "> and APPLY_RESULT like concat('%', #{applyResult}, '%') </if>
|
<if test="applyContent != null and applyContent != '' "> and APPLY_CONTENT like concat('%', #{applyContent}, '%') </if>
|
</where>
|
</select>
|
|
<select id="selectDsMatDispatchByDeptId" parameterType="DsMatDispatch2" resultMap="DsMatDispatchResult">
|
<include refid="selectDsMatDispatchVo" />
|
<where>
|
<if test="resHarborId != null and resHarborId != ''"> and (RES_HARBOR_ID = #{resHarborId} or DES_HARBOR_ID = #{resHarborId} ) </if>
|
<if test="status != null and status != ''"> and STATUS = #{status} </if>
|
</where>
|
</select>
|
|
<select id="selectDsMatDispatchById" parameterType="Long" resultMap="DsMatDispatchResult" >
|
<include refid="selectDsMatDispatchVo" />
|
where ID = #{id}
|
</select>
|
|
<select id="selectDsMatDispatchForApply" resultMap="DsMatDispatchResult" >
|
<include refid="selectDsMatDispatchVo" />
|
where STATUS != '1' ORDER BY CREATE_TIME DESC
|
</select>
|
|
<insert id="insertDsMatDispatch" parameterType="DsMatDispatch2">
|
insert into DS_MAT_DISPATCH
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">ID,</if>
|
<if test="resHarborId != null">RES_HARBOR_ID,</if>
|
<if test="resHarborName != null">RES_HARBOR_NAME,</if>
|
<if test="desHarborId != null">DES_HARBIR_ID,</if>
|
<if test="desHarborName != null">DES_HARBOR_NAME,</if>
|
<if test="content != null">CONTENT,</if>
|
<if test="createBy != null">CREATE_BY,</if>
|
<if test="createTime != null">CREATE_TIME,</if>
|
<if test="updateBy != null">UPDATE_BY,</if>
|
<if test="updateTime != null">UPDATE_TIME,</if>
|
<if test="remark != null">REMARK,</if>
|
<if test="status != null">STATUS,</if>
|
<if test="applyBy != null">APPLY_BY,</if>
|
<if test="applyTime != null">APPLY_TIME,</if>
|
<if test="applyResult != null">APPLY_RESULT,</if>
|
<if test="applyContent != null">APPLY_CONTENT,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="resHarborId != null">#{resHarborId},</if>
|
<if test="resHarborName != null">#{resHarborName},</if>
|
<if test="desHarborId != null">#{desHarborId},</if>
|
<if test="desHarborName != null">#{desHarborName},</if>
|
<if test="content != null">#{content},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="status != null">#{status},</if>
|
<if test="applyBy != null">#{applyBy},</if>
|
<if test="applyTime != null">#{applyTime},</if>
|
<if test="applyResult != null">#{applyResult},</if>
|
<if test="applyContent != null">#{applyContent},</if>
|
</trim>
|
</insert>
|
|
<update id="updateDsMatDispatch" parameterType="DsMatDispatch2">
|
update DS_MAT_DISPATCH
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="resHarborId != null"> RES_HARBOR_ID = #{resHarborId},</if>
|
<if test="resHarborName != null"> RES_HARBOR_NAME = #{resHarborName},</if>
|
<if test="desHarborId != null"> DES_HARBOR_ID = #{desHarborId},</if>
|
<if test="desHarborName != null"> DES_HARBOR_NAME = #{desHarborName},</if>
|
<if test="content != null"> CONTENT = #{content},</if>
|
<if test="updateBy != null"> UPDATE_BY = #{updateBy},</if>
|
<if test="updateTime != null"> UPDATE_TIME = #{updateTime},</if>
|
<if test="remark != null"> REMARK = #{remark},</if>
|
<if test="status != null"> STATUS = #{status},</if>
|
<if test="applyBy != null"> APPLY_BY = #{applyBy}, </if>
|
<if test="applyTime != null"> APPLY_TIME = #{applyTime},</if>
|
<if test="applyResult != null"> APPLY_RESULT = #{applyResult},</if>
|
<if test="applyContent != null"> APPLY_CONTENT = #{applyContent},</if>
|
</trim>
|
where ID = #{id}
|
</update>
|
|
<delete id="deleteDsMatDispatchById" parameterType="Long" >
|
delete from DS_MAT_DISPATCH where ID = #{id}
|
</delete>
|
|
<delete id="deleteDsMatDispatchByIds" parameterType="String">
|
delete from DS_MAT_DISPATCH where ID in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|