yujian
2019-10-21 d085ca89e39b4cda025a9a53d3797fbe8b242ae7
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
<?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.yeshi.fanli.dao.mybatis.order.OrderSubsidyMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.OrderSubsidy">
    <id column="os_id" property="id" jdbcType="BIGINT"/>
    <result column="os_uid" property="uid" jdbcType="BIGINT"/>
    <result column="os_money" property="money" jdbcType="DECIMAL"/>
    <result column="os_order_no" property="orderNo" jdbcType="VARCHAR"/>
    <result column="os_source_type" property="sourceType" jdbcType="INTEGER"/>
    <result column="os_state" property="state" jdbcType="INTEGER"/>
    <result column="os_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="os_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">os_id,</if>
      <if test="uid != null">os_uid,</if>
      <if test="money != null">os_money,</if>
      <if test="orderNo != null">os_order_no,</if>
      <if test="sourceType != null">os_source_type,</if>
      <if test="state != null">os_state,</if>
      <if test="createTime != null">os_create_time,</if>
      <if test="updateTime != null">os_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
      <if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy">update yeshi_ec_order_subsidy set os_uid = #{uid,jdbcType=BIGINT},os_money = #{money,jdbcType=DECIMAL},os_order_no = #{orderNo,jdbcType=VARCHAR},os_source_type = #{sourceType,jdbcType=INTEGER},os_state = #{state,jdbcType=INTEGER},os_create_time = #{createTime,jdbcType=TIMESTAMP},os_update_time = #{updateTime,jdbcType=TIMESTAMP} where os_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy">update yeshi_ec_order_subsidy
    <set>
      <if test="uid != null">os_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="money != null">os_money=#{money,jdbcType=DECIMAL},</if>
      <if test="orderNo != null">os_order_no=#{orderNo,jdbcType=VARCHAR},</if>
      <if test="sourceType != null">os_source_type=#{sourceType,jdbcType=INTEGER},</if>
      <if test="state != null">os_state=#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">os_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">os_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where os_id = #{id,jdbcType=BIGINT}
  </update>
  
  
  <select id="getByOrderNoAndType" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_order_subsidy 
     WHERE os_uid = #{uid} AND os_order_no = #{orderNo}  AND os_source_type = #{type}
     LIMIT 1
  </select>
  
</mapper>