|
@@ -0,0 +1,913 @@
|
|
|
|
|
+<?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.ProductInfoMapper">
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ProductInfo">
|
|
|
|
|
+ <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="service_type" property="serviceType" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="subclass" property="subclass" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="title" property="title" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="image" property="image" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="service_detail" property="serviceDetail" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="inventory" property="inventory" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="on_shelf" property="onShelf" jdbcType="CHAR"/>
|
|
|
|
|
+ <result column="use_flag" property="useFlag" jdbcType="CHAR"/>
|
|
|
|
|
+ <result column="hot_flag" property="hotFlag" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="home_flag" property="homeFlag" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="rank" property="rank" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="store_id" property="storeId" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="type_flag" property="typeFlag" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="sales_volume" property="salesVolume" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="price" property="price" jdbcType="DECIMAL"/>
|
|
|
|
|
+ <result column="product_detail" property="productDetail" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="out_url" property="outUrl" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result column="out_flag" property="outFlag" jdbcType="CHAR"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
|
+ id,
|
|
|
|
|
+
|
|
|
|
|
+ del_flag,
|
|
|
|
|
+
|
|
|
|
|
+ update_time,
|
|
|
|
|
+
|
|
|
|
|
+ update_user,
|
|
|
|
|
+
|
|
|
|
|
+ create_time,
|
|
|
|
|
+
|
|
|
|
|
+ create_user,
|
|
|
|
|
+
|
|
|
|
|
+ service_type,
|
|
|
|
|
+
|
|
|
|
|
+ subclass,
|
|
|
|
|
+
|
|
|
|
|
+ title,
|
|
|
|
|
+
|
|
|
|
|
+ image,
|
|
|
|
|
+
|
|
|
|
|
+ service_detail,
|
|
|
|
|
+
|
|
|
|
|
+ inventory,
|
|
|
|
|
+
|
|
|
|
|
+ on_shelf,
|
|
|
|
|
+
|
|
|
|
|
+ use_flag,
|
|
|
|
|
+
|
|
|
|
|
+ hot_flag,
|
|
|
|
|
+
|
|
|
|
|
+ home_flag,
|
|
|
|
|
+
|
|
|
|
|
+ rank,
|
|
|
|
|
+
|
|
|
|
|
+ store_id,
|
|
|
|
|
+
|
|
|
|
|
+ type_flag,
|
|
|
|
|
+
|
|
|
|
|
+ sales_volume,
|
|
|
|
|
+
|
|
|
|
|
+ price,
|
|
|
|
|
+
|
|
|
|
|
+ product_detail,
|
|
|
|
|
+
|
|
|
|
|
+ out_url,
|
|
|
|
|
+
|
|
|
|
|
+ out_flag,
|
|
|
|
|
+
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </sql>
|
|
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
+ delete from product_info
|
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ProductInfo" useGeneratedKeys="true"
|
|
|
|
|
+ keyProperty="id">
|
|
|
|
|
+ insert into product_info
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <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="serviceType!= null">
|
|
|
|
|
+ service_type,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass!= null">
|
|
|
|
|
+ subclass,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title!= null">
|
|
|
|
|
+ title,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image!= null">
|
|
|
|
|
+ image,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail!= null">
|
|
|
|
|
+ service_detail,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory!= null">
|
|
|
|
|
+ inventory,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf!= null">
|
|
|
|
|
+ on_shelf,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag!= null">
|
|
|
|
|
+ use_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag!= null">
|
|
|
|
|
+ hot_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag!= null">
|
|
|
|
|
+ home_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank!= null">
|
|
|
|
|
+ rank,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId!= null">
|
|
|
|
|
+ store_id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag!= null">
|
|
|
|
|
+ type_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume!= null">
|
|
|
|
|
+ sales_volume,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="price!= null">
|
|
|
|
|
+ price,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productDetail!= null">
|
|
|
|
|
+ product_detail,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outUrl!= null">
|
|
|
|
|
+ out_url,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outFlag != null">
|
|
|
|
|
+ out_flag,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <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="serviceType != null">
|
|
|
|
|
+ #{serviceType,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass != null">
|
|
|
|
|
+ #{subclass,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ #{title,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image != null">
|
|
|
|
|
+ #{image,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail != null">
|
|
|
|
|
+ #{serviceDetail,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory != null">
|
|
|
|
|
+ #{inventory,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf != null">
|
|
|
|
|
+ #{onShelf,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag != null">
|
|
|
|
|
+ #{useFlag,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag != null">
|
|
|
|
|
+ #{hotFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag != null">
|
|
|
|
|
+ #{homeFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank != null">
|
|
|
|
|
+ #{rank,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId != null">
|
|
|
|
|
+ #{storeId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag != null">
|
|
|
|
|
+ #{typeFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume != null">
|
|
|
|
|
+ #{salesVolume,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="price != null">
|
|
|
|
|
+ #{price,jdbcType=DECIMAL},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productDetail != null">
|
|
|
|
|
+ #{productDetail,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outUrl != null">
|
|
|
|
|
+ #{outUrl,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outFlag != null">
|
|
|
|
|
+ #{outFlag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ProductInfo">
|
|
|
|
|
+ update product_info
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <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="serviceType != null">
|
|
|
|
|
+ service_type= #{serviceType,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass != null">
|
|
|
|
|
+ subclass= #{subclass,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ title= #{title,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image != null">
|
|
|
|
|
+ image= #{image,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail != null">
|
|
|
|
|
+ service_detail= #{serviceDetail,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory != null">
|
|
|
|
|
+ inventory= #{inventory,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf != null">
|
|
|
|
|
+ on_shelf= #{onShelf,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag != null">
|
|
|
|
|
+ use_flag= #{useFlag,jdbcType=CHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag != null">
|
|
|
|
|
+ hot_flag= #{hotFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag != null">
|
|
|
|
|
+ home_flag= #{homeFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank != null">
|
|
|
|
|
+ rank= #{rank,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId != null">
|
|
|
|
|
+ store_id= #{storeId,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag != null">
|
|
|
|
|
+ type_flag= #{typeFlag,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume != null">
|
|
|
|
|
+ sales_volume= #{salesVolume,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="price != null">
|
|
|
|
|
+ price= #{price,jdbcType=DECIMAL},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="productDetail != null">
|
|
|
|
|
+ product_detail= #{productDetail,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outUrl != null">
|
|
|
|
|
+ out_url= #{outUrl,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="outFlag != null">
|
|
|
|
|
+ out_flag = #{outFlag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </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="queryProductInfoByPage" parameterType="java.util.Map"
|
|
|
|
|
+ resultMap="AllInfoForGetList">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
|
|
+
|
|
|
|
|
+ (SELECT
|
|
|
|
|
+ AVG(
|
|
|
|
|
+ star_level + service_level + reply_level
|
|
|
|
|
+ ) / 3
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `product_comment`
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ del_flag = 'N'
|
|
|
|
|
+ AND product_id = product_info.id ) as dsr
|
|
|
|
|
+
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 'N'
|
|
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
|
|
+ and id = #{record.id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.idStr != null and !"".equals(record.idStr)">
|
|
|
|
|
+ and id in (${record.idStr})
|
|
|
|
|
+ </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.serviceType != null and !"".equals(record.serviceType)">
|
|
|
|
|
+ and service_type = #{record.serviceType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.subclass != null and !"".equals(record.subclass)">
|
|
|
|
|
+ and subclass = #{record.subclass}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.title != null and !"".equals(record.title)">
|
|
|
|
|
+ and title = #{record.title}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.image != null and !"".equals(record.image)">
|
|
|
|
|
+ and image = #{record.image}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.serviceDetail != null and !"".equals(record.serviceDetail)">
|
|
|
|
|
+ and service_detail = #{record.serviceDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.inventory != null and !"".equals(record.inventory)">
|
|
|
|
|
+ and inventory = #{record.inventory}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.onShelf != null and !"".equals(record.onShelf)">
|
|
|
|
|
+ and on_shelf = #{record.onShelf}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.useFlag != null and !"".equals(record.useFlag)">
|
|
|
|
|
+ and use_flag = #{record.useFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.hotFlag != null and !"".equals(record.hotFlag)">
|
|
|
|
|
+ and hot_flag = #{record.hotFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.homeFlag != null and !"".equals(record.homeFlag)">
|
|
|
|
|
+ and home_flag = #{record.homeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.rank != null and !"".equals(record.rank)">
|
|
|
|
|
+ and rank = #{record.rank}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.storeId != null and !"".equals(record.storeId)">
|
|
|
|
|
+ and store_id = #{record.storeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.typeFlag != null and !"".equals(record.typeFlag)">
|
|
|
|
|
+ and type_flag = #{record.typeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.salesVolume != null and !"".equals(record.salesVolume)">
|
|
|
|
|
+ and sales_volume = #{record.salesVolume}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.minPrice != null and !"".equals(record.minPrice)">
|
|
|
|
|
+ <![CDATA[and price >= #{record.minPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.maxPrice != null and !"".equals(record.maxPrice)">
|
|
|
|
|
+ <![CDATA[and price <= #{record.maxPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
|
|
+ OR service_type LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR subclass LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR title LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR service_detail LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR inventory LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR on_shelf LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR use_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR hot_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR home_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR rank LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR store_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR type_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ OR sales_volume LIKE concat('%',#{record.searchKey},'%')
|
|
|
|
|
+ </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>
|
|
|
|
|
+ rank desc, id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="queryAllProductInfo" parameterType="java.util.Map"
|
|
|
|
|
+ resultType="com.izouma.awesomeadmin.model.ProductInfo">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
|
|
+ (SELECT
|
|
|
|
|
+ AVG(
|
|
|
|
|
+ product_comment.star_level + product_comment.service_level + product_comment.reply_level
|
|
|
|
|
+ ) / 3
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `product_comment`
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ product_comment.del_flag = 'N'
|
|
|
|
|
+ AND product_comment.product_id = product_info.id ) as dsr
|
|
|
|
|
+
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 'N'
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ and id = #{id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
|
|
+ and id in (${idStr})
|
|
|
|
|
+ </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="serviceType != null and !"".equals(serviceType)">
|
|
|
|
|
+ and service_type = #{serviceType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
|
|
+ and subclass = #{subclass}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null and !"".equals(title)">
|
|
|
|
|
+ and title = #{title}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
|
|
+ and image = #{image}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail != null and !"".equals(serviceDetail)">
|
|
|
|
|
+ and service_detail = #{serviceDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory != null and !"".equals(inventory)">
|
|
|
|
|
+ and inventory = #{inventory}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf != null and !"".equals(onShelf)">
|
|
|
|
|
+ and on_shelf = #{onShelf}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
|
|
+ and use_flag = #{useFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag != null and !"".equals(hotFlag)">
|
|
|
|
|
+ and hot_flag = #{hotFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag != null and !"".equals(homeFlag)">
|
|
|
|
|
+ and home_flag = #{homeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
|
|
+ and rank = #{rank}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId != null and !"".equals(storeId)">
|
|
|
|
|
+ and store_id = #{storeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag != null and !"".equals(typeFlag)">
|
|
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume != null and !"".equals(salesVolume)">
|
|
|
|
|
+ and sales_volume = #{salesVolume}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="minPrice != null and !"".equals(minPrice)">
|
|
|
|
|
+ <![CDATA[and price >= #{minPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="maxPrice != null and !"".equals(maxPrice)">
|
|
|
|
|
+ <![CDATA[and price <= #{maxPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
|
|
+ OR service_type LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR subclass LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR title LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR service_detail LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR inventory LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR on_shelf LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR use_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR hot_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR home_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR store_id LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR type_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR sales_volume LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ </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>
|
|
|
|
|
+
|
|
|
|
|
+ rank desc, id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="queryAllProductInfoForHome" parameterType="java.util.Map"
|
|
|
|
|
+ resultType="com.izouma.awesomeadmin.model.ProductInfo">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
|
|
+ (SELECT
|
|
|
|
|
+ AVG(
|
|
|
|
|
+ product_comment.star_level + product_comment.service_level + product_comment.reply_level
|
|
|
|
|
+ ) / 3
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `product_comment`
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ product_comment.del_flag = 'N'
|
|
|
|
|
+ AND product_comment.product_id = product_info.id ) as dsr
|
|
|
|
|
+
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 'N'
|
|
|
|
|
+ and use_flag = 'Y'
|
|
|
|
|
+ and on_shelf = 'Y'
|
|
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
|
|
+ and id = #{id}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
|
|
+ and id in (${idStr})
|
|
|
|
|
+ </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="serviceType != null and !"".equals(serviceType)">
|
|
|
|
|
+ and service_type = #{serviceType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
|
|
+ and subclass = #{subclass}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null and !"".equals(title)">
|
|
|
|
|
+ and title = #{title}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
|
|
+ and image = #{image}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail != null and !"".equals(serviceDetail)">
|
|
|
|
|
+ and service_detail = #{serviceDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory != null and !"".equals(inventory)">
|
|
|
|
|
+ and inventory = #{inventory}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf != null and !"".equals(onShelf)">
|
|
|
|
|
+ and on_shelf = #{onShelf}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
|
|
+ and use_flag = #{useFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag != null and !"".equals(hotFlag)">
|
|
|
|
|
+ and hot_flag = #{hotFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag != null and !"".equals(homeFlag)">
|
|
|
|
|
+ and home_flag = #{homeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
|
|
+ and rank = #{rank}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId != null and !"".equals(storeId)">
|
|
|
|
|
+ and store_id = #{storeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag != null and !"".equals(typeFlag)">
|
|
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume != null and !"".equals(salesVolume)">
|
|
|
|
|
+ and sales_volume = #{salesVolume}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="minPrice != null and !"".equals(minPrice)">
|
|
|
|
|
+ <![CDATA[and price >= #{minPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="maxPrice != null and !"".equals(maxPrice)">
|
|
|
|
|
+ <![CDATA[and price <= #{maxPrice}]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
|
|
+ OR service_type LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR subclass LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR title LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR service_detail LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR inventory LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR on_shelf LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR use_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR hot_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR home_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR store_id LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR type_flag LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ OR sales_volume LIKE concat('%',#{searchKey},'%')
|
|
|
|
|
+ </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>
|
|
|
|
|
+
|
|
|
|
|
+ rank desc, id desc
|
|
|
|
|
+
|
|
|
|
|
+ LIMIT 4
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="queryProductInfo" parameterType="java.util.Map" resultMap="AllInfoForGetOne">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 'N'
|
|
|
|
|
+ <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="serviceType != null and !"".equals(serviceType)">
|
|
|
|
|
+ and service_type = #{serviceType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
|
|
+ and subclass = #{subclass}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null and !"".equals(title)">
|
|
|
|
|
+ and title = #{title}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
|
|
+ and image = #{image}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="serviceDetail != null and !"".equals(serviceDetail)">
|
|
|
|
|
+ and service_detail = #{serviceDetail}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="inventory != null and !"".equals(inventory)">
|
|
|
|
|
+ and inventory = #{inventory}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="onShelf != null and !"".equals(onShelf)">
|
|
|
|
|
+ and on_shelf = #{onShelf}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
|
|
+ and use_flag = #{useFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hotFlag != null and !"".equals(hotFlag)">
|
|
|
|
|
+ and hot_flag = #{hotFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="homeFlag != null and !"".equals(homeFlag)">
|
|
|
|
|
+ and home_flag = #{homeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
|
|
+ and rank = #{rank}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="storeId != null and !"".equals(storeId)">
|
|
|
|
|
+ and store_id = #{storeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="typeFlag != null and !"".equals(typeFlag)">
|
|
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="salesVolume != null and !"".equals(salesVolume)">
|
|
|
|
|
+ and sales_volume = #{salesVolume}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </where>
|
|
|
|
|
+ LIMIT 1
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <update id="delete">
|
|
|
|
|
+ UPDATE product_info SET del_flag = 'Y'
|
|
|
|
|
+ <where>
|
|
|
|
|
+ AND id = #{id}
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductInfo">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
|
+ from product_info
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 'N'
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap id="AllInfoForGetOne" type="com.izouma.awesomeadmin.model.ProductInfo" extends="BaseResultMap">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <association property="storeInfo"
|
|
|
|
|
+ javaType="com.izouma.awesomeadmin.model.StoreInfo"
|
|
|
|
|
+ select="com.izouma.awesomeadmin.dao.StoreInfoMapper.queryStoreInfo"
|
|
|
|
|
+ column="{ id = store_id }"/>
|
|
|
|
|
+
|
|
|
|
|
+ <collection property="productPriceList"
|
|
|
|
|
+ ofType="com.izouma.awesomeadmin.model.ProductPrice"
|
|
|
|
|
+ select="com.izouma.awesomeadmin.dao.ProductPriceMapper.queryAllProductPrice"
|
|
|
|
|
+ column="{ productId = id }"/>
|
|
|
|
|
+
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <resultMap id="AllInfoForGetList" type="com.izouma.awesomeadmin.model.ProductInfo" extends="BaseResultMap">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <association property="storeInfo"
|
|
|
|
|
+ javaType="com.izouma.awesomeadmin.model.StoreInfo"
|
|
|
|
|
+ select="com.izouma.awesomeadmin.dao.StoreInfoMapper.queryStoreInfo"
|
|
|
|
|
+ column="{ id = store_id }"/>
|
|
|
|
|
+
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|
|
|
|
|
+
|