|
@@ -0,0 +1,524 @@
|
|
|
|
|
+<?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.izouma.awesomeadmin.dao.ProductSkuMapper">
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
|
|
|
|
|
+ <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
|
|
|
|
+ <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
|
|
|
+ <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="product_id" property="productId" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="sku_num" property="skuNum" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="sku_price" property="skuPrice" jdbcType="DECIMAL"/>
|
|
|
|
|
+ <result column="properties_id" property="propertiesId" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="properties_name" property="propertiesName" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="sku_name" property="skuName" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="item_id" property="itemId" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="bar_code" property="barCode" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="product_code" property="productCode" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ id, del_flag, update_time, update_user, create_time, create_user, product_id, sku_num, sku_price, properties_id, properties_name, sku_name, item_id, bar_code, product_code, status_flag <!--generatedEnd-->
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
|
+ FROM product_sku
|
|
|
|
|
+ WHERE id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
+ DELETE
|
|
|
|
|
+ FROM product_sku
|
|
|
|
|
+ WHERE id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ProductSku" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ INSERT INTO product_sku
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="id!= null">
|
|
|
|
|
+ id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag!= null">
|
|
|
|
|
+ del_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime!= null">
|
|
|
|
|
+ update_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateUser!= null">
|
|
|
|
|
+ update_user,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime!= null">
|
|
|
|
|
+ create_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createUser!= null">
|
|
|
|
|
+ create_user,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productId!= null">
|
|
|
|
|
+ product_id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuNum!= null">
|
|
|
|
|
+ sku_num,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuPrice!= null">
|
|
|
|
|
+ sku_price,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesId!= null">
|
|
|
|
|
+ properties_id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesName!= null">
|
|
|
|
|
+ properties_name,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName!= null">
|
|
|
|
|
+ sku_name,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemId!= null">
|
|
|
|
|
+ item_id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="barCode!= null">
|
|
|
|
|
+ bar_code,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productCode!= null">
|
|
|
|
|
+ product_code,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="statusFlag!= null">
|
|
|
|
|
+ status_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag != null">
|
|
|
|
|
+ #{delFlag,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateUser != null">
|
|
|
|
|
+ #{updateUser,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createUser != null">
|
|
|
|
|
+ #{createUser,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productId != null">
|
|
|
|
|
+ #{productId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuNum != null">
|
|
|
|
|
+ #{skuNum,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuPrice != null">
|
|
|
|
|
+ #{skuPrice,jdbcType=DECIMAL},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesId != null">
|
|
|
|
|
+ #{propertiesId,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesName != null">
|
|
|
|
|
+ #{propertiesName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName != null">
|
|
|
|
|
+ #{skuName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemId != null">
|
|
|
|
|
+ #{itemId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="barCode != null">
|
|
|
|
|
+ #{barCode,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productCode != null">
|
|
|
|
|
+ #{productCode,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="statusFlag != null">
|
|
|
|
|
+ #{statusFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ UPDATE product_sku
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="id != null">
|
|
|
|
|
+ id= #{id,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag != null">
|
|
|
|
|
+ del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
|
+ update_time= #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateUser != null">
|
|
|
|
|
+ update_user= #{updateUser,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
|
+ create_time= #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createUser != null">
|
|
|
|
|
+ create_user= #{createUser,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productId != null">
|
|
|
|
|
+ product_id= #{productId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuNum != null">
|
|
|
|
|
+ sku_num= #{skuNum,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuPrice != null">
|
|
|
|
|
+ sku_price= #{skuPrice,jdbcType=DECIMAL},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesId != null">
|
|
|
|
|
+ properties_id= #{propertiesId,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesName != null">
|
|
|
|
|
+ properties_name= #{propertiesName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName != null">
|
|
|
|
|
+ sku_name= #{skuName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemId != null">
|
|
|
|
|
+ item_id= #{itemId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="barCode != null">
|
|
|
|
|
+ bar_code= #{barCode,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productCode != null">
|
|
|
|
|
+ product_code= #{productCode,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="statusFlag != null">
|
|
|
|
|
+ status_flag= #{statusFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </set>
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
|
|
+ id IN (${idStr})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryProductSkuByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_sku
|
|
|
|
|
+ <where>
|
|
|
|
|
+ AND del_flag = 'N'
|
|
|
|
|
+ <if test="record.idStr != null and !"".equals(record.idStr)">
|
|
|
|
|
+ AND id IN (${record.idStr})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
|
|
+ AND id = #{record.id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
|
|
+ AND del_flag = #{record.delFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.updateTime != null and !"".equals(record.updateTime)">
|
|
|
|
|
+ AND update_time = #{record.updateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.updateUser != null and !"".equals(record.updateUser)">
|
|
|
|
|
+ AND update_user = #{record.updateUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.createTime != null and !"".equals(record.createTime)">
|
|
|
|
|
+ AND create_time = #{record.createTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.createUser != null and !"".equals(record.createUser)">
|
|
|
|
|
+ AND create_user = #{record.createUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.productId != null and !"".equals(record.productId)">
|
|
|
|
|
+ AND product_id = #{record.productId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.skuNum != null and !"".equals(record.skuNum)">
|
|
|
|
|
+ AND sku_num = #{record.skuNum}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.skuPrice != null and !"".equals(record.skuPrice)">
|
|
|
|
|
+ AND sku_price = #{record.skuPrice}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.propertiesId != null and !"".equals(record.propertiesId)">
|
|
|
|
|
+ AND properties_id = #{record.propertiesId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.propertiesName != null and !"".equals(record.propertiesName)">
|
|
|
|
|
+ AND properties_name = #{record.propertiesName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.skuName != null and !"".equals(record.skuName)">
|
|
|
|
|
+ AND sku_name = #{record.skuName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.itemId != null and !"".equals(record.itemId)">
|
|
|
|
|
+ AND item_id = #{record.itemId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.barCode != null and !"".equals(record.barCode)">
|
|
|
|
|
+ AND bar_code = #{record.barCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.productCode != null and !"".equals(record.productCode)">
|
|
|
|
|
+ AND product_code = #{record.productCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.statusFlag != null and !"".equals(record.statusFlag)">
|
|
|
|
|
+ AND status_flag = #{record.statusFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ OR product_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR sku_num LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR sku_price LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR properties_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR properties_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR sku_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR item_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR bar_code LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR product_code LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR status_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="record.advancedQuery != null and !"".equals(record.advancedQuery)">
|
|
|
|
|
+ <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ <if test="detailIndex == 3">
|
|
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailIndex < 3">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ <if test="detailIndex == 3">
|
|
|
|
|
+ #{itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailIndex < 3">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ <if test="record.orderByStr != null and !"".equals(record.orderByStr)">
|
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
|
+ <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ ,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ id DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryAllProductSku" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_sku
|
|
|
|
|
+ <where>
|
|
|
|
|
+ AND del_flag = 'N'
|
|
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
|
|
+ AND id IN (${idStr})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ AND id = #{id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
|
|
+ AND del_flag = #{delFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
|
|
+ AND update_time = #{updateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
|
|
+ AND update_user = #{updateUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
|
|
+ AND create_time = #{createTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createUser != null and !"".equals(createUser)">
|
|
|
|
|
+ AND create_user = #{createUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productId != null and !"".equals(productId)">
|
|
|
|
|
+ AND product_id = #{productId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuNum != null and !"".equals(skuNum)">
|
|
|
|
|
+ AND sku_num = #{skuNum}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuPrice != null and !"".equals(skuPrice)">
|
|
|
|
|
+ AND sku_price = #{skuPrice}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesId != null and !"".equals(propertiesId)">
|
|
|
|
|
+ AND properties_id = #{propertiesId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesName != null and !"".equals(propertiesName)">
|
|
|
|
|
+ AND properties_name = #{propertiesName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName != null and !"".equals(skuName)">
|
|
|
|
|
+ AND sku_name = #{skuName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemId != null and !"".equals(itemId)">
|
|
|
|
|
+ AND item_id = #{itemId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="barCode != null and !"".equals(barCode)">
|
|
|
|
|
+ AND bar_code = #{barCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productCode != null and !"".equals(productCode)">
|
|
|
|
|
+ AND product_code = #{productCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="statusFlag != null and !"".equals(statusFlag)">
|
|
|
|
|
+ AND status_flag = #{statusFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ OR product_id LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR sku_num LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR sku_price LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR properties_id LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR properties_name LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR sku_name LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR item_id LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR bar_code LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR product_code LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR status_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="advancedQuery != null and !"".equals(advancedQuery)">
|
|
|
|
|
+ <foreach item="item" index="index" collection="advancedQuery.split('_;')">
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ <if test="detailIndex == 3">
|
|
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailIndex < 3">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ <if test="detailIndex == 3">
|
|
|
|
|
+ #{itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailIndex < 3">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ <if test="orderByStr != null and !"".equals(orderByStr)">
|
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
|
+ <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
|
|
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
|
|
+ ${itemDetail}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ ,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ id DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryProductSku" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_sku
|
|
|
|
|
+ <where>
|
|
|
|
|
+ AND del_flag = 'N'
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ AND id = #{id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
|
|
+ AND del_flag = #{delFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
|
|
+ AND update_time = #{updateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
|
|
+ AND update_user = #{updateUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
|
|
+ AND create_time = #{createTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createUser != null and !"".equals(createUser)">
|
|
|
|
|
+ AND create_user = #{createUser}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productId != null and !"".equals(productId)">
|
|
|
|
|
+ AND product_id = #{productId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuNum != null and !"".equals(skuNum)">
|
|
|
|
|
+ AND sku_num = #{skuNum}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuPrice != null and !"".equals(skuPrice)">
|
|
|
|
|
+ AND sku_price = #{skuPrice}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesId != null and !"".equals(propertiesId)">
|
|
|
|
|
+ AND properties_id = #{propertiesId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="propertiesName != null and !"".equals(propertiesName)">
|
|
|
|
|
+ AND properties_name = #{propertiesName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName != null and !"".equals(skuName)">
|
|
|
|
|
+ AND sku_name = #{skuName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="itemId != null and !"".equals(itemId)">
|
|
|
|
|
+ AND item_id = #{itemId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="barCode != null and !"".equals(barCode)">
|
|
|
|
|
+ AND bar_code = #{barCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productCode != null and !"".equals(productCode)">
|
|
|
|
|
+ AND product_code = #{productCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="statusFlag != null and !"".equals(statusFlag)">
|
|
|
|
|
+ AND status_flag = #{statusFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </where>
|
|
|
|
|
+ LIMIT 1
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="delete">
|
|
|
|
|
+ UPDATE product_sku SET del_flag = 'Y'
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
|
|
+ id IN (${idStr})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductSku">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
|
+ FROM product_sku
|
|
|
|
|
+ <where>
|
|
|
|
|
+ AND del_flag = 'N'
|
|
|
|
|
+ <!--generatedStart-->
|
|
|
|
|
+ <!--generatedEnd-->
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY id DESC
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|
|
|
|
|
+
|