hdy
2025-02-27 bf5dcc46de28c2ca664be4c6c3566e0a82c1ecd6
提交 | 用户 | 时间
76a2cd 1 <?xml version="1.0" encoding="UTF-8" ?>
H 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.DaStationCollectionMapper">
6     
7     <resultMap type="DaStationCollection" id="DaStationCollectionResult">
8         <result property="id"    column="id"    />
9         <result property="sfcCode"    column="sfc_code"    />
10         <result property="locationCode"    column="location_code"    />
11         <result property="inboundTime"    column="inbound_time"    />
12         <result property="outboundTime"    column="outbound_time"    />
13         <result property="status"    column="status"    />
14         <result property="collectTime"    column="collect_time"    />
15     </resultMap>
16
17     <sql id="selectDaStationCollectionVo">
18         select id, sfc_code, location_code, inbound_time, outbound_time, status, collect_time from da_station_collection
19     </sql>
20
21     <select id="selectDaStationCollectionList" parameterType="DaStationCollection" resultMap="DaStationCollectionResult">
22         <include refid="selectDaStationCollectionVo"/>
23         <where>  
24             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
25             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
26             <if test="inboundTime != null "> and inbound_time = #{inboundTime}</if>
27             <if test="outboundTime != null "> and outbound_time = #{outboundTime}</if>
28             <if test="status != null  and status != ''"> and status = #{status}</if>
29             <if test="collectTime != null "> and collect_time = #{collectTime}</if>
30         </where>
31     </select>
32     
33     <select id="selectDaStationCollectionById" parameterType="Long" resultMap="DaStationCollectionResult">
34         <include refid="selectDaStationCollectionVo"/>
35         where id = #{id}
36     </select>
37
38     <insert id="insertDaStationCollection" parameterType="DaStationCollection" useGeneratedKeys="true" keyProperty="id">
39         insert into da_station_collection
40         <trim prefix="(" suffix=")" suffixOverrides=",">
41             <if test="sfcCode != null">sfc_code,</if>
42             <if test="locationCode != null">location_code,</if>
43             <if test="inboundTime != null">inbound_time,</if>
44             <if test="outboundTime != null">outbound_time,</if>
45             <if test="status != null">status,</if>
46             <if test="collectTime != null">collect_time,</if>
47          </trim>
48         <trim prefix="values (" suffix=")" suffixOverrides=",">
49             <if test="sfcCode != null">#{sfcCode},</if>
50             <if test="locationCode != null">#{locationCode},</if>
51             <if test="inboundTime != null">#{inboundTime},</if>
52             <if test="outboundTime != null">#{outboundTime},</if>
53             <if test="status != null">#{status},</if>
54             <if test="collectTime != null">#{collectTime},</if>
55          </trim>
56     </insert>
57
58     <update id="updateDaStationCollection" parameterType="DaStationCollection">
59         update da_station_collection
60         <trim prefix="SET" suffixOverrides=",">
61             <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
62             <if test="locationCode != null">location_code = #{locationCode},</if>
63             <if test="inboundTime != null">inbound_time = #{inboundTime},</if>
64             <if test="outboundTime != null">outbound_time = #{outboundTime},</if>
65             <if test="status != null">status = #{status},</if>
66             <if test="collectTime != null">collect_time = #{collectTime},</if>
67         </trim>
68         where id = #{id}
69     </update>
70
71     <delete id="deleteDaStationCollectionById" parameterType="Long">
72         delete from da_station_collection where id = #{id}
73     </delete>
74
75     <delete id="deleteDaStationCollectionByIds" parameterType="String">
76         delete from da_station_collection where id in 
77         <foreach item="id" collection="array" open="(" separator="," close=")">
78             #{id}
79         </foreach>
80     </delete>
81 </mapper>