13693261870
2025-07-02 6708810c4de34dfb9513061432d656f91d56ee3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?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>