提交 | 用户 | 时间
|
9d822f
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
A |
2 |
<!DOCTYPE mapper |
|
3 |
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
4 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
5 |
<mapper namespace="com.billion.main.da.mapper.DaMaterialCollectionMapper"> |
|
6 |
|
|
7 |
<resultMap type="DaMaterialCollection" id="DaMaterialCollectionResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="sfcCode" column="sfc_code" /> |
|
10 |
<result property="locationCode" column="location_code" /> |
|
11 |
<result property="paramCode" column="param_code" /> |
|
12 |
<result property="paramName" column="param_name" /> |
|
13 |
<result property="paramValue" column="param_value" /> |
|
14 |
<result property="collectTime" column="collect_time" /> |
|
15 |
</resultMap> |
|
16 |
|
|
17 |
<sql id="selectDaMaterialCollectionVo"> |
|
18 |
select id, sfc_code, location_code, param_code, param_name, param_value, collect_time from da_material_collection |
|
19 |
</sql> |
|
20 |
|
|
21 |
<select id="selectDaMaterialCollectionList" parameterType="DaMaterialCollection" resultMap="DaMaterialCollectionResult"> |
|
22 |
<include refid="selectDaMaterialCollectionVo"/> |
|
23 |
<where> |
|
24 |
<if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if> |
|
25 |
<if test="locationCode != null and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if> |
|
26 |
<if test="paramCode != null and paramCode != ''"> and param_code like concat('%', #{paramCode}, '%')</if> |
|
27 |
<if test="paramName != null and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if> |
7933a5
|
28 |
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"><!-- 开始时间检索 --> |
A |
29 |
and collect_time BETWEEN #{params.beginTime} and #{params.endTime} |
|
30 |
</if> |
9d822f
|
31 |
</where> |
A |
32 |
</select> |
|
33 |
|
|
34 |
<select id="selectDaMaterialCollectionById" parameterType="Long" resultMap="DaMaterialCollectionResult"> |
|
35 |
<include refid="selectDaMaterialCollectionVo"/> |
|
36 |
where id = #{id} |
|
37 |
</select> |
|
38 |
|
|
39 |
<insert id="insertDaMaterialCollection" parameterType="DaMaterialCollection" useGeneratedKeys="true" keyProperty="id"> |
|
40 |
insert into da_material_collection |
|
41 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
42 |
<if test="sfcCode != null">sfc_code,</if> |
|
43 |
<if test="locationCode != null">location_code,</if> |
|
44 |
<if test="paramCode != null">param_code,</if> |
|
45 |
<if test="paramName != null">param_name,</if> |
|
46 |
<if test="paramValue != null">param_value,</if> |
|
47 |
<if test="collectTime != null">collect_time,</if> |
|
48 |
</trim> |
|
49 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
50 |
<if test="sfcCode != null">#{sfcCode},</if> |
|
51 |
<if test="locationCode != null">#{locationCode},</if> |
|
52 |
<if test="paramCode != null">#{paramCode},</if> |
|
53 |
<if test="paramName != null">#{paramName},</if> |
|
54 |
<if test="paramValue != null">#{paramValue},</if> |
|
55 |
<if test="collectTime != null">#{collectTime},</if> |
|
56 |
</trim> |
|
57 |
</insert> |
|
58 |
|
|
59 |
<update id="updateDaMaterialCollection" parameterType="DaMaterialCollection"> |
|
60 |
update da_material_collection |
|
61 |
<trim prefix="SET" suffixOverrides=","> |
|
62 |
<if test="sfcCode != null">sfc_code = #{sfcCode},</if> |
|
63 |
<if test="locationCode != null">location_code = #{locationCode},</if> |
|
64 |
<if test="paramCode != null">param_code = #{paramCode},</if> |
|
65 |
<if test="paramName != null">param_name = #{paramName},</if> |
|
66 |
<if test="paramValue != null">param_value = #{paramValue},</if> |
|
67 |
<if test="collectTime != null">collect_time = #{collectTime},</if> |
|
68 |
</trim> |
|
69 |
where id = #{id} |
|
70 |
</update> |
|
71 |
|
|
72 |
<delete id="deleteDaMaterialCollectionById" parameterType="Long"> |
|
73 |
delete from da_material_collection where id = #{id} |
|
74 |
</delete> |
|
75 |
|
|
76 |
<delete id="deleteDaMaterialCollectionByIds" parameterType="String"> |
|
77 |
delete from da_material_collection where id in |
|
78 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
79 |
#{id} |
|
80 |
</foreach> |
|
81 |
</delete> |
|
82 |
</mapper> |