|
|
@@ -0,0 +1,141 @@
|
|
|
+<?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.dk.mnls_mp.mapper.mnls.IbossGoodsCodeMapper">
|
|
|
+
|
|
|
+ <!-- 通用设置 -->
|
|
|
+ <!-- 通用查询列 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, item_id, only_code, code, goods_name, specification, package_num, kind_name, series_name, variety_name, create_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mnls_mp.model.pojo.mnls.IbossGoodsCode">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="item_id" property="itemId"/>
|
|
|
+ <result column="only_code" property="onlyCode"/>
|
|
|
+ <result column="code" property="code"/>
|
|
|
+ <result column="goods_name" property="goodsName"/>
|
|
|
+ <result column="specification" property="specification"/>
|
|
|
+ <result column="package_num" property="packageNum"/>
|
|
|
+ <result column="kind_name" property="kindName"/>
|
|
|
+ <result column="series_name" property="seriesName"/>
|
|
|
+ <result column="variety_name" property="varietyName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用条件列 -->
|
|
|
+ <sql id="Condition">
|
|
|
+ <where>
|
|
|
+ <if test="itemId != null">
|
|
|
+ AND item_id = #{itemId}
|
|
|
+ </if>
|
|
|
+ <if test="onlyCode != null and onlyCode != ''">
|
|
|
+ AND only_code = #{onlyCode}
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ AND code = #{code}
|
|
|
+ </if>
|
|
|
+ <if test="goodsName != null and goodsName != ''">
|
|
|
+ AND goods_name = #{goodsName}
|
|
|
+ </if>
|
|
|
+ <if test="specification != null and specification != ''">
|
|
|
+ AND specification = #{specification}
|
|
|
+ </if>
|
|
|
+ <if test="packageNum != null">
|
|
|
+ AND package_num = #{packageNum}
|
|
|
+ </if>
|
|
|
+ <if test="kindName != null and kindName != ''">
|
|
|
+ AND kind_name = #{kindName}
|
|
|
+ </if>
|
|
|
+ <if test="seriesName != null and seriesName != ''">
|
|
|
+ AND series_name = #{seriesName}
|
|
|
+ </if>
|
|
|
+ <if test="varietyName != null and varietyName != ''">
|
|
|
+ AND variety_name = #{varietyName}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ AND create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="idsForeach">
|
|
|
+ <!-- 根据主键id批量操作 -->
|
|
|
+ WHERE id in
|
|
|
+ <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询表t_iboss_goods_code,(条件查询+分页)列表 -->
|
|
|
+ <select id="selectByCond" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_iboss_goods_code
|
|
|
+ <include refid="Condition"/>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询表t_iboss_goods_code,(条件查询)个数 -->
|
|
|
+ <select id="countByCond" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM t_iboss_goods_code
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据主键锁定表t_iboss_goods_code的一行数据 -->
|
|
|
+ <select id="selectByIdForUpdate" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_iboss_goods_code
|
|
|
+ WHERE id = #{id}
|
|
|
+ for update
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键锁定表t_iboss_goods_code的多行数据 -->
|
|
|
+ <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM t_iboss_goods_code
|
|
|
+ <include refid="idsForeach"/>
|
|
|
+ for update
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into t_iboss_goods_code
|
|
|
+ (
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ item_id,
|
|
|
+ only_code,
|
|
|
+ code,
|
|
|
+ goods_name,
|
|
|
+ specification,
|
|
|
+ package_num,
|
|
|
+ kind_name,
|
|
|
+ series_name,
|
|
|
+ variety_name,
|
|
|
+ create_time,
|
|
|
+ </trim>
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
+ (
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ #{item.itemId},
|
|
|
+ #{item.onlyCode},
|
|
|
+ #{item.code},
|
|
|
+ #{item.goodsName},
|
|
|
+ #{item.specification},
|
|
|
+ #{item.packageNum},
|
|
|
+ #{item.kindName},
|
|
|
+ #{item.seriesName},
|
|
|
+ #{item.varietyName},
|
|
|
+ #{item.createTime},
|
|
|
+ </trim>
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|