Blame view

parking-module-bill/src/main/resources/mybatis/mapper/TBillingLogsMapper.xml 4.62 KB
55f68655   王彪总   新项目
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
  <?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.zteits.bill.mapper.TBillingLogsMapper" >
    <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBillingLogs" >
      <id column="id" property="id" jdbcType="VARCHAR" />
      <result column="pl_no" property="plNo" jdbcType="VARCHAR" />
      <result column="car_num" property="carNum" jdbcType="VARCHAR" />
      <result column="in_time" property="inTime" jdbcType="TIMESTAMP" />
      <result column="out_time" property="outTime" jdbcType="TIMESTAMP" />
      <result column="fee" property="fee" jdbcType="INTEGER" />
    </resultMap>
    <resultMap id="ResultMapWithBLOBs" type="com.zteits.bill.domain.TBillingLogs" extends="BaseResultMap" >
      <result column="log_detail" property="logDetail" jdbcType="LONGVARCHAR" />
    </resultMap>
    <sql id="Base_Column_List" >
      id, pl_no, car_num, in_time, out_time, fee
    </sql>
    <sql id="Blob_Column_List" >
      log_detail
    </sql>
    <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
      select 
      <include refid="Base_Column_List" />
      ,
      <include refid="Blob_Column_List" />
      from t_billing_logs
      where id = #{id,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
      delete from t_billing_logs
      where id = #{id,jdbcType=VARCHAR}
    </delete>
    <insert id="insert" parameterType="com.zteits.bill.domain.TBillingLogs" >
  
      insert into t_billing_logs (id,pl_no, car_num, in_time,
        out_time, fee, log_detail
        )
      values (#{id,jdbcType=VARCHAR},#{plNo,jdbcType=VARCHAR}, #{carNum,jdbcType=VARCHAR}, #{inTime,jdbcType=TIMESTAMP},
        #{outTime,jdbcType=TIMESTAMP}, #{fee,jdbcType=INTEGER}, #{logDetail,jdbcType=LONGVARCHAR}
        )
    </insert>
    <insert id="insertSelective" parameterType="com.zteits.bill.domain.TBillingLogs" >
      <selectKey resultType="java.lang.String" keyProperty="id" order="AFTER" >
        SELECT LAST_INSERT_ID()
      </selectKey>
      insert into t_billing_logs
      <trim prefix="(" suffix=")" suffixOverrides="," >
        <if test="plNo != null" >
          pl_no,
        </if>
        <if test="carNum != null" >
          car_num,
        </if>
        <if test="inTime != null" >
          in_time,
        </if>
        <if test="outTime != null" >
          out_time,
        </if>
        <if test="fee != null" >
          fee,
        </if>
        <if test="logDetail != null" >
          log_detail,
        </if>
      </trim>
      <trim prefix="values (" suffix=")" suffixOverrides="," >
        <if test="plNo != null" >
          #{plNo,jdbcType=VARCHAR},
        </if>
        <if test="carNum != null" >
          #{carNum,jdbcType=VARCHAR},
        </if>
        <if test="inTime != null" >
          #{inTime,jdbcType=TIMESTAMP},
        </if>
        <if test="outTime != null" >
          #{outTime,jdbcType=TIMESTAMP},
        </if>
        <if test="fee != null" >
          #{fee,jdbcType=INTEGER},
        </if>
        <if test="logDetail != null" >
          #{logDetail,jdbcType=LONGVARCHAR},
        </if>
      </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TBillingLogs" >
      update t_billing_logs
      <set >
        <if test="plNo != null" >
          pl_no = #{plNo,jdbcType=VARCHAR},
        </if>
        <if test="carNum != null" >
          car_num = #{carNum,jdbcType=VARCHAR},
        </if>
        <if test="inTime != null" >
          in_time = #{inTime,jdbcType=TIMESTAMP},
        </if>
        <if test="outTime != null" >
          out_time = #{outTime,jdbcType=TIMESTAMP},
        </if>
        <if test="fee != null" >
          fee = #{fee,jdbcType=INTEGER},
        </if>
        <if test="logDetail != null" >
          log_detail = #{logDetail,jdbcType=LONGVARCHAR},
        </if>
      </set>
      where id = #{id,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zteits.bill.domain.TBillingLogs" >
      update t_billing_logs
      set pl_no = #{plNo,jdbcType=VARCHAR},
        car_num = #{carNum,jdbcType=VARCHAR},
        in_time = #{inTime,jdbcType=TIMESTAMP},
        out_time = #{outTime,jdbcType=TIMESTAMP},
        fee = #{fee,jdbcType=INTEGER},
        log_detail = #{logDetail,jdbcType=LONGVARCHAR}
      where id = #{id,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TBillingLogs" >
      update t_billing_logs
      set pl_no = #{plNo,jdbcType=VARCHAR},
        car_num = #{carNum,jdbcType=VARCHAR},
        in_time = #{inTime,jdbcType=TIMESTAMP},
        out_time = #{outTime,jdbcType=TIMESTAMP},
        fee = #{fee,jdbcType=INTEGER}
      where id = #{id,jdbcType=VARCHAR}
    </update>
  </mapper>