hdy
7 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
849473 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.bs.mapper.BsRouteChildInfoMapper">
6     
7     <resultMap type="BsRouteChildInfo" id="BsRouteChildInfoResult">
8         <result property="id"    column="id"    />
9         <result property="productCode"    column="product_code"    />
10         <result property="productName"    column="product_name"    />
11         <result property="locationCode"    column="location_code"    />
12         <result property="locationName"    column="location_name"    />
13         <result property="stepNo"    column="step_no"    />
14         <result property="createBy"    column="create_by"    />
15         <result property="createTime"    column="create_time"    />
16         <result property="updateBy"    column="update_by"    />
17         <result property="updateTime"    column="update_time"    />
18         <result property="delFlag"    column="del_flag"    />
19         <result property="routeCode"    column="route_code"    />
20     </resultMap>
21
22     <sql id="selectBsRouteChildInfoVo">
23         select id, product_code, product_name, location_code, location_name, step_no, create_by, create_time, update_by, update_time, del_flag, route_code from bs_route_child_info
24     </sql>
25
26     <select id="selectBsRouteChildInfoList" parameterType="BsRouteChildInfo" resultMap="BsRouteChildInfoResult">
27         <include refid="selectBsRouteChildInfoVo"/>
28         <where>  
29             <if test="productCode != null  and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
30             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
31             <if test="locationCode != null  and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if>
32             <if test="locationName != null  and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
33             <if test="routeCode != null  and routeCode != ''"> and route_code = #{routeCode}</if>
34         </where>
35     </select>
36     
37     <select id="selectBsRouteChildInfoById" parameterType="Long" resultMap="BsRouteChildInfoResult">
38         <include refid="selectBsRouteChildInfoVo"/>
39         where id = #{id}
40     </select>
41
42     <insert id="insertBsRouteChildInfo" parameterType="BsRouteChildInfo">
43         insert into bs_route_child_info
44         <trim prefix="(" suffix=")" suffixOverrides=",">
45             <if test="id != null">id,</if>
46             <if test="productCode != null and productCode != ''">product_code,</if>
47             <if test="productName != null">product_name,</if>
48             <if test="locationCode != null and locationCode != ''">location_code,</if>
49             <if test="locationName != null">location_name,</if>
50             <if test="stepNo != null">step_no,</if>
51             <if test="createBy != null">create_by,</if>
52             <if test="createTime != null">create_time,</if>
53             <if test="updateBy != null">update_by,</if>
54             <if test="updateTime != null">update_time,</if>
55             <if test="delFlag != null">del_flag,</if>
56             <if test="routeCode != null">route_code,</if>
57          </trim>
58         <trim prefix="values (" suffix=")" suffixOverrides=",">
59             <if test="id != null">#{id},</if>
60             <if test="productCode != null and productCode != ''">#{productCode},</if>
61             <if test="productName != null">#{productName},</if>
62             <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
63             <if test="locationName != null">#{locationName},</if>
64             <if test="stepNo != null">#{stepNo},</if>
65             <if test="createBy != null">#{createBy},</if>
66             <if test="createTime != null">#{createTime},</if>
67             <if test="updateBy != null">#{updateBy},</if>
68             <if test="updateTime != null">#{updateTime},</if>
69             <if test="delFlag != null">#{delFlag},</if>
70             <if test="routeCode != null">#{routeCode},</if>
71          </trim>
72     </insert>
73
74     <update id="updateBsRouteChildInfo" parameterType="BsRouteChildInfo">
75         update bs_route_child_info
76         <trim prefix="SET" suffixOverrides=",">
77             <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
78             <if test="productName != null">product_name = #{productName},</if>
79             <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
80             <if test="locationName != null">location_name = #{locationName},</if>
81             <if test="stepNo != null">step_no = #{stepNo},</if>
82             <if test="createBy != null">create_by = #{createBy},</if>
83             <if test="createTime != null">create_time = #{createTime},</if>
84             <if test="updateBy != null">update_by = #{updateBy},</if>
85             <if test="updateTime != null">update_time = #{updateTime},</if>
86             <if test="delFlag != null">del_flag = #{delFlag},</if>
87             <if test="routeCode != null">route_code = #{routeCode},</if>
88         </trim>
89         where id = #{id}
90     </update>
91
92     <delete id="deleteBsRouteChildInfoById" parameterType="Long">
93         delete from bs_route_child_info where id = #{id}
94     </delete>
95
96     <delete id="deleteBsRouteChildInfoByIds" parameterType="String">
97         delete from bs_route_child_info where id in 
98         <foreach item="id" collection="array" open="(" separator="," close=")">
99             #{id}
100         </foreach>
101     </delete>
102 </mapper>