郑永安
2023-06-19 2fcd97552d16718cc7997629fd637a73a5a4483f
src/main/java/com/gk/firework/Mapper/mybatis/ProductLocusInfoMapper.xml
对比新文件
@@ -0,0 +1,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>