hdy
7 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
dea0a3 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.BsLocationInfoMapper">
6     
7     <resultMap type="BsLocationInfo" id="BsLocationInfoResult">
8         <result property="id"    column="id"    />
9         <result property="locationCode"    column="location_code"    />
10         <result property="locationName"    column="location_name"    />
11         <result property="locationType"    column="location_type"    />
12         <result property="lineCode"    column="line_code"    />
13         <result property="remarks"    column="remarks"    />
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     </resultMap>
20
21     <sql id="selectBsLocationInfoVo">
22         select id, location_code, location_name, location_type, line_code, remarks, create_by, create_time, update_by, update_time, del_flag from bs_location_info
23     </sql>
24
25     <select id="selectBsLocationInfoList" parameterType="BsLocationInfo" resultMap="BsLocationInfoResult">
26         <include refid="selectBsLocationInfoVo"/>
27         <where>  
28             <if test="locationCode != null  and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if>
29             <if test="locationName != null  and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
30             <if test="locationType != null  and locationType != ''"> and location_type = #{locationType}</if>
31             <if test="lineCode != null  and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
32         </where>
33     </select>
34     
35     <select id="selectBsLocationInfoById" parameterType="Long" resultMap="BsLocationInfoResult">
36         <include refid="selectBsLocationInfoVo"/>
37         where id = #{id}
38     </select>
39
40     <insert id="insertBsLocationInfo" parameterType="BsLocationInfo">
41         insert into bs_location_info
42         <trim prefix="(" suffix=")" suffixOverrides=",">
43             <if test="id != null">id,</if>
44             <if test="locationCode != null">location_code,</if>
45             <if test="locationName != null">location_name,</if>
46             <if test="locationType != null">location_type,</if>
47             <if test="lineCode != null">line_code,</if>
48             <if test="remarks != null">remarks,</if>
49             <if test="createBy != null">create_by,</if>
50             <if test="createTime != null">create_time,</if>
51             <if test="updateBy != null">update_by,</if>
52             <if test="updateTime != null">update_time,</if>
53             <if test="delFlag != null">del_flag,</if>
54          </trim>
55         <trim prefix="values (" suffix=")" suffixOverrides=",">
56             <if test="id != null">#{id},</if>
57             <if test="locationCode != null">#{locationCode},</if>
58             <if test="locationName != null">#{locationName},</if>
59             <if test="locationType != null">#{locationType},</if>
60             <if test="lineCode != null">#{lineCode},</if>
61             <if test="remarks != null">#{remarks},</if>
62             <if test="createBy != null">#{createBy},</if>
63             <if test="createTime != null">#{createTime},</if>
64             <if test="updateBy != null">#{updateBy},</if>
65             <if test="updateTime != null">#{updateTime},</if>
66             <if test="delFlag != null">#{delFlag},</if>
67          </trim>
68     </insert>
69
70     <update id="updateBsLocationInfo" parameterType="BsLocationInfo">
71         update bs_location_info
72         <trim prefix="SET" suffixOverrides=",">
73             <if test="locationCode != null">location_code = #{locationCode},</if>
74             <if test="locationName != null">location_name = #{locationName},</if>
75             <if test="locationType != null">location_type = #{locationType},</if>
76             <if test="lineCode != null">line_code = #{lineCode},</if>
77             <if test="remarks != null">remarks = #{remarks},</if>
78             <if test="createBy != null">create_by = #{createBy},</if>
79             <if test="createTime != null">create_time = #{createTime},</if>
80             <if test="updateBy != null">update_by = #{updateBy},</if>
81             <if test="updateTime != null">update_time = #{updateTime},</if>
82             <if test="delFlag != null">del_flag = #{delFlag},</if>
83         </trim>
84         where id = #{id}
85     </update>
86
87     <delete id="deleteBsLocationInfoById" parameterType="Long">
88         delete from bs_location_info where id = #{id}
89     </delete>
90
91     <delete id="deleteBsLocationInfoByIds" parameterType="String">
92         delete from bs_location_info where id in 
93         <foreach item="id" collection="array" open="(" separator="," close=")">
94             #{id}
95         </foreach>
96     </delete>
97 </mapper>