admin
2022-08-25 c9db68e33f90231b064b8864fc69ccf7d25f5e0b
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
<?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.ks.lijin.mapper.LiJinGoofsDepotFirstOrderMapper">
  <resultMap id="BaseResultMap" type="com.ks.lijin.pojo.DO.LiJinGoofsDepotFirstOrder">
    <id column="gd_goods_id" property="goodsId" jdbcType="VARCHAR"/>
    <result column="gd_money" property="money" jdbcType="DECIMAL"/>
    <result column="gd_state" property="state" jdbcType="INTEGER"/>
    <result column="gd_creator_id" property="creatorId" jdbcType="BIGINT"/>
    <result column="gd_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="gd_updator_id" property="updatorId" jdbcType="BIGINT"/>
    <result column="gd_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">gd_goods_id,gd_money,gd_state,gd_creator_id,gd_create_time,gd_updator_id,gd_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from tlj_goofs_depot_first_order where gd_goods_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from tlj_goofs_depot_first_order where gd_goods_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.ks.lijin.pojo.DO.LiJinGoofsDepotFirstOrder" useGeneratedKeys="true" keyProperty="id">insert into tlj_goofs_depot_first_order (gd_goods_id, gd_money, gd_state, gd_creator_id, gd_create_time, gd_updator_id, gd_update_time)values (#{id,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL}, #{state,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updatorId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.ks.lijin.pojo.DO.LiJinGoofsDepotFirstOrder" useGeneratedKeys="true" keyProperty="id">insert into tlj_goofs_depot_first_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="goodsId != null">gd_goods_id,</if>
      <if test="money != null">gd_money,</if>
      <if test="state != null">gd_state,</if>
      <if test="creatorId != null">gd_creator_id,</if>
      <if test="createTime != null">gd_create_time,</if>
      <if test="updatorId != null">gd_updator_id,</if>
      <if test="updateTime != null">gd_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="goodsId != null">#{id,jdbcType=VARCHAR},</if>
      <if test="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="creatorId != null">#{creatorId,jdbcType=BIGINT},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updatorId != null">#{updatorId,jdbcType=BIGINT},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.ks.lijin.pojo.DO.LiJinGoofsDepotFirstOrder">update tlj_goofs_depot_first_order set gd_money = #{money,jdbcType=DECIMAL},gd_state = #{state,jdbcType=INTEGER},gd_creator_id = #{creatorId,jdbcType=BIGINT},gd_create_time = #{createTime,jdbcType=TIMESTAMP},gd_updator_id = #{updatorId,jdbcType=BIGINT},gd_update_time = #{updateTime,jdbcType=TIMESTAMP}where gd_goods_id = #{id,jdbcType=VARCHAR}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ks.lijin.pojo.DO.LiJinGoofsDepotFirstOrder">update tlj_goofs_depot_first_order
    <set>
      <if test="money != null">gd_money=#{money,jdbcType=DECIMAL},</if>
      <if test="state != null">gd_state=#{state,jdbcType=INTEGER},</if>
      <if test="creatorId != null">gd_creator_id=#{creatorId,jdbcType=BIGINT},</if>
      <if test="createTime != null">gd_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updatorId != null">gd_updator_id=#{updatorId,jdbcType=BIGINT},</if>
      <if test="updateTime != null">gd_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where gd_goods_id = #{goodsId,jdbcType=VARCHAR}
  </update>
 
  <!-- 非模板 -->
  <sql id="listWhere">
    <if test="query.id!=null">and gd_goods_id=#{query.id}</if>
    <if test="query.state!=null">and gd_state=#{query.state}</if>
  </sql>
 
 
  <select id="listByPage" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"/>   from tlj_goofs_depot_first_order
    where 1=1
    <include refid="listWhere"/>
    limit #{query.start},#{query.count}
  </select>
 
  <select id="count" resultType="java.lang.Long">
    select count(*) from tlj_goofs_depot_first_order
    where 1=1
    <include refid="listWhere"/>
  </select>
 
</mapper>