Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?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.gk.firework.Mapper.ProductLocusInfoMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.ProductLocusInfo" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="directioncode" property="directioncode" jdbcType="VARCHAR" />
    <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
    <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" />
    <result column="content" property="content" jdbcType="VARCHAR" />
    <result column="customerid" property="customerid" jdbcType="BIGINT" />
    <result column="type" property="type" jdbcType="TINYINT" />
    <result column="boxcode" property="boxcode" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, directioncode, createddate, modifieddate, content, customerid, type, boxcode
  </sql>
 
  <insert id="insertProductLocus"  >
    insert into productlocus${slice}
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="productLocusInfo.id != null" >
        id,
      </if>
      <if test="productLocusInfo.directioncode != null" >
        directioncode,
      </if>
      <if test="productLocusInfo.createddate != null" >
        createddate,
      </if>
      <if test="productLocusInfo.modifieddate != null" >
        modifieddate,
      </if>
      <if test="productLocusInfo.content != null" >
        content,
      </if>
      <if test="productLocusInfo.customerid != null" >
        customerid,
      </if>
      <if test="productLocusInfo.type != null" >
        `type`,
      </if>
      <if test="productLocusInfo.boxcode != null" >
        `boxcode`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="productLocusInfo.id != null" >
        #{productLocusInfo.id,jdbcType=BIGINT},
      </if>
      <if test="productLocusInfo.directioncode != null" >
        #{productLocusInfo.directioncode,jdbcType=VARCHAR},
      </if>
      <if test="productLocusInfo.createddate != null" >
        #{productLocusInfo.createddate,jdbcType=TIMESTAMP},
      </if>
      <if test="productLocusInfo.modifieddate != null" >
        #{productLocusInfo.modifieddate,jdbcType=TIMESTAMP},
      </if>
      <if test="productLocusInfo.content != null" >
        #{productLocusInfo.content,jdbcType=VARCHAR},
      </if>
      <if test="productLocusInfo.customerid != null" >
        #{productLocusInfo.customerid,jdbcType=BIGINT},
      </if>
      <if test="productLocusInfo.type != null" >
        #{productLocusInfo.type,jdbcType=TINYINT},
      </if>
      <if test="productLocusInfo.boxcode != null" >
        #{productLocusInfo.boxcode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
    <insert id="insertBatch">
 
        <foreach collection="list" item="item" separator=";">
            insert into
            productlocus${item.slice}
            <trim prefix="(" suffix=") values" suffixOverrides=",">
              directioncode,
              createddate,
              modifieddate,
              content,
              customerid,
              `type`,
              `boxcode`,
            </trim>
            <trim prefix="(" suffix=")" suffixOverrides=",">
                #{item.directioncode},
                #{item.createddate},
                #{item.modifieddate},
                #{item.content},
                #{item.customerid},
                #{item.type},
                #{item.boxcode},
 
            </trim>
 
        </foreach>
 
    </insert>
    <select id="selectLists" resultType="com.gk.firework.Domain.Vo.ProductLocusVo">
      select
      pl.id,
      pl.directioncode,
      pl.modifieddate,
      pl.createddate,
      pl.content,
      pl.type,
      case pl.type when 1 then '入库' when 2 then '退货入库'  when 3 then '出库' when 4 then '销售' when 5 then '退库'
      when 6 then '生成电子标签' when 7 then '补打' when 8 then '电子标签回退'
      end typename,
      pl.boxcode,
      cu.idcardnum ,
      INSERT ( cu.idcardnum, 7, 6, '******' ) idCardNumber
      from productlocus${slice} as pl
      left join customer as cu on cu.id = pl.customerid
      where pl.directioncode = #{directionCode}
    </select>
  <select id="selectFlowByCodes" resultType="com.gk.firework.Domain.Vo.ProductLocusVo">
      select
      pl.id,
      pl.directioncode,
      pl.modifieddate,
      pl.createddate,
      pl.content,
      pl.type,
      pl.customerid,
      case pl.type when 1 then '入库' when 2 then '退货入库'  when 3 then '出库' when 4 then '销售' when 5 then '退库'
      when 6 then '生成电子标签' when 7 then '补打' when 8 then '电子标签回退'
      end typename,
      pl.boxcode,
      cu.idcardnum ,
      INSERT ( cu.idcardnum, 7, 6, '******' ) idCardNumber
      from productlocus${slice} as pl
      left join customer as cu on cu.id = pl.customerid
      where directioncode in
      <foreach collection="codes" index="index" item="item" open="("
               separator="," close=")">
        #{item}
      </foreach>
  </select>
 
</mapper>