LogisticsManagementMapper.xml
6.05 KB
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
<?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.trash.office.mapper.LogisticsManagementMapper">
<resultMap type="LogisticsManagement" id="LogisticsManagementResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="deptId" column="dept_id" />
<result property="sealType" column="seal_type" />
<result property="sealUpdateTime" column="seal_update_time" />
<result property="sealEndTime" column="seal_end_time" />
<result property="purpose" column="purpose" />
<result property="staff" column="staff" />
<result property="useDate" column="use_date" />
<result property="goodsName" column="goods_name" />
<result property="quantity" column="quantity" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectLogisticsManagementVo">
select id, type, dept_id, seal_type, seal_update_time, seal_end_time, purpose, staff, use_date, goods_name, quantity, status, create_time, create_by, update_time, update_by from office_logistics_management
</sql>
<select id="selectLogisticsManagementList" parameterType="LogisticsManagement" resultMap="LogisticsManagementResult">
<include refid="selectLogisticsManagementVo"/>
<where>
<if test="type != null "> and type = #{type}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="sealType != null and sealType != ''"> and seal_type = #{sealType}</if>
<if test="sealUpdateTime != null "> and seal_update_time = #{sealUpdateTime}</if>
<if test="sealEndTime != null "> and seal_end_time = #{sealEndTime}</if>
<if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
<if test="staff != null and staff != ''"> and staff = #{staff}</if>
<if test="useDate != null "> and use_date = #{useDate}</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectLogisticsManagementById" parameterType="Long" resultMap="LogisticsManagementResult">
<include refid="selectLogisticsManagementVo"/>
where id = #{id}
</select>
<insert id="insertLogisticsManagement" parameterType="LogisticsManagement" useGeneratedKeys="true" keyProperty="id">
insert into office_logistics_management
<trim prefix="(" suffix=")" suffixOverrides=",">
create_time,
<if test="type != null">type,</if>
<if test="deptId != null">dept_id,</if>
<if test="sealType != null">seal_type,</if>
<if test="sealUpdateTime != null">seal_update_time,</if>
<if test="sealEndTime != null">seal_end_time,</if>
<if test="purpose != null">purpose,</if>
<if test="staff != null">staff,</if>
<if test="useDate != null">use_date,</if>
<if test="goodsName != null">goods_name,</if>
<if test="quantity != null">quantity,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
now(),
<if test="type != null">#{type},</if>
<if test="deptId != null">#{deptId},</if>
<if test="sealType != null">#{sealType},</if>
<if test="sealUpdateTime != null">#{sealUpdateTime},</if>
<if test="sealEndTime != null">#{sealEndTime},</if>
<if test="purpose != null">#{purpose},</if>
<if test="staff != null">#{staff},</if>
<if test="useDate != null">#{useDate},</if>
<if test="goodsName != null">#{goodsName},</if>
<if test="quantity != null">#{quantity},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
</trim>
</insert>
<update id="updateLogisticsManagement" parameterType="LogisticsManagement">
update office_logistics_management
<trim prefix="SET" suffixOverrides=",">
update_time = now(),
<if test="type != null">type = #{type},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="sealType != null">seal_type = #{sealType},</if>
<if test="sealUpdateTime != null">seal_update_time = #{sealUpdateTime},</if>
<if test="sealEndTime != null">seal_end_time = #{sealEndTime},</if>
<if test="purpose != null">purpose = #{purpose},</if>
<if test="staff != null">staff = #{staff},</if>
<if test="useDate != null">use_date = #{useDate},</if>
<if test="goodsName != null">goods_name = #{goodsName},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="status != null">status = #{status},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLogisticsManagementById" parameterType="Long">
delete from office_logistics_management where id = #{id}
</delete>
<delete id="deleteLogisticsManagementByIds" parameterType="String">
delete from office_logistics_management where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>