|
|
@@ -0,0 +1,1500 @@
|
|
|
+<?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.StoreInfoMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ <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="user_id" property="userId" jdbcType="INTEGER"/>
|
|
|
+ <result column="user_name" property="userName" jdbcType="VARCHAR"/>
|
|
|
+ <result column="store_name" property="storeName" jdbcType="VARCHAR"/>
|
|
|
+ <result column="service_type" property="serviceType" jdbcType="VARCHAR"/>
|
|
|
+ <result column="description" property="description" jdbcType="VARCHAR"/>
|
|
|
+ <result column="icon" property="icon" jdbcType="VARCHAR"/>
|
|
|
+ <result column="province" property="province" jdbcType="VARCHAR"/>
|
|
|
+ <result column="citye" property="citye" jdbcType="VARCHAR"/>
|
|
|
+ <result column="district" property="district" jdbcType="VARCHAR"/>
|
|
|
+ <result column="address_detail" property="addressDetail" jdbcType="VARCHAR"/>
|
|
|
+ <result column="bank_card" property="bankCard" jdbcType="VARCHAR"/>
|
|
|
+ <result column="bank_name" property="bankName" jdbcType="VARCHAR"/>
|
|
|
+ <result column="open_name" property="openName" jdbcType="VARCHAR"/>
|
|
|
+ <result column="credit" property="credit" jdbcType="VARCHAR"/>
|
|
|
+ <result column="use_flag" property="useFlag" jdbcType="CHAR"/>
|
|
|
+ <result column="rank" property="rank" jdbcType="INTEGER"/>
|
|
|
+ <result column="response_time" property="responseTime" jdbcType="INTEGER"/>
|
|
|
+ <result column="rework_rate" property="reworkRate" jdbcType="INTEGER"/>
|
|
|
+ <result column="hot_flag" property="hotFlag" jdbcType="INTEGER"/>
|
|
|
+ <result column="home_flag" property="homeFlag" jdbcType="INTEGER"/>
|
|
|
+ <result column="type_flag" property="typeFlag" jdbcType="INTEGER"/>
|
|
|
+ <result column="subclass" property="subclass" jdbcType="VARCHAR"/>
|
|
|
+ <result column="storelabel" property="storelabel" jdbcType="VARCHAR"/>
|
|
|
+ <result column="memory_space" property="memorySpace" jdbcType="DECIMAL"/>
|
|
|
+ <result column="alibaba" property="alibaba" jdbcType="VARCHAR"/>
|
|
|
+ <result column="qq" property="qq" jdbcType="VARCHAR"/>
|
|
|
+ <result column="alibaba_nick" property="alibabaNick" jdbcType="VARCHAR"/>
|
|
|
+ <result column="qq_nick" property="qqNick" jdbcType="VARCHAR"/>
|
|
|
+ <result column="signing" property="signing" jdbcType="CHAR"/>
|
|
|
+ <result column="album_price" property="albumPrice" jdbcType="INTEGER"/>
|
|
|
+ <result column="rate_flag" property="rateFlag" jdbcType="CHAR"/>
|
|
|
+ <result column="order_rate" property="orderRate" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ id,
|
|
|
+
|
|
|
+ del_flag,
|
|
|
+
|
|
|
+ update_time,
|
|
|
+
|
|
|
+ update_user,
|
|
|
+
|
|
|
+ create_time,
|
|
|
+
|
|
|
+ create_user,
|
|
|
+
|
|
|
+ user_id,
|
|
|
+
|
|
|
+ user_name,
|
|
|
+
|
|
|
+ store_name,
|
|
|
+
|
|
|
+ service_type,
|
|
|
+
|
|
|
+ description,
|
|
|
+
|
|
|
+ icon,
|
|
|
+
|
|
|
+ province,
|
|
|
+
|
|
|
+ citye,
|
|
|
+
|
|
|
+ district,
|
|
|
+
|
|
|
+ address_detail,
|
|
|
+
|
|
|
+ bank_card,
|
|
|
+
|
|
|
+ bank_name,
|
|
|
+
|
|
|
+ open_name,
|
|
|
+
|
|
|
+ credit,
|
|
|
+
|
|
|
+ use_flag,
|
|
|
+
|
|
|
+ rank,
|
|
|
+
|
|
|
+ response_time,
|
|
|
+
|
|
|
+ rework_rate,
|
|
|
+
|
|
|
+ hot_flag,
|
|
|
+
|
|
|
+ home_flag,
|
|
|
+
|
|
|
+ type_flag,
|
|
|
+
|
|
|
+ subclass,
|
|
|
+
|
|
|
+ storelabel,
|
|
|
+
|
|
|
+ memory_space,
|
|
|
+
|
|
|
+ alibaba,
|
|
|
+
|
|
|
+ qq,
|
|
|
+
|
|
|
+ alibaba_nick,
|
|
|
+
|
|
|
+ qq_nick,
|
|
|
+ signing,
|
|
|
+ album_price,
|
|
|
+ rate_flag,
|
|
|
+ order_rate,
|
|
|
+
|
|
|
+ </trim>
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from store_info
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from store_info
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.StoreInfo" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into store_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="userId!= null">
|
|
|
+ user_id,
|
|
|
+ </if>
|
|
|
+ <if test="userName!= null">
|
|
|
+ user_name,
|
|
|
+ </if>
|
|
|
+ <if test="storeName!= null">
|
|
|
+ store_name,
|
|
|
+ </if>
|
|
|
+ <if test="serviceType!= null">
|
|
|
+ service_type,
|
|
|
+ </if>
|
|
|
+ <if test="description!= null">
|
|
|
+ description,
|
|
|
+ </if>
|
|
|
+ <if test="icon!= null">
|
|
|
+ icon,
|
|
|
+ </if>
|
|
|
+ <if test="province!= null">
|
|
|
+ province,
|
|
|
+ </if>
|
|
|
+ <if test="citye!= null">
|
|
|
+ citye,
|
|
|
+ </if>
|
|
|
+ <if test="district!= null">
|
|
|
+ district,
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail!= null">
|
|
|
+ address_detail,
|
|
|
+ </if>
|
|
|
+ <if test="bankCard!= null">
|
|
|
+ bank_card,
|
|
|
+ </if>
|
|
|
+ <if test="bankName!= null">
|
|
|
+ bank_name,
|
|
|
+ </if>
|
|
|
+ <if test="openName!= null">
|
|
|
+ open_name,
|
|
|
+ </if>
|
|
|
+ <if test="credit!= null">
|
|
|
+ credit,
|
|
|
+ </if>
|
|
|
+ <if test="useFlag!= null">
|
|
|
+ use_flag,
|
|
|
+ </if>
|
|
|
+ <if test="rank!= null">
|
|
|
+ rank,
|
|
|
+ </if>
|
|
|
+ <if test="responseTime!= null">
|
|
|
+ response_time,
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate!= null">
|
|
|
+ rework_rate,
|
|
|
+ </if>
|
|
|
+ <if test="hotFlag!= null">
|
|
|
+ hot_flag,
|
|
|
+ </if>
|
|
|
+ <if test="homeFlag!= null">
|
|
|
+ home_flag,
|
|
|
+ </if>
|
|
|
+ <if test="typeFlag!= null">
|
|
|
+ type_flag,
|
|
|
+ </if>
|
|
|
+ <if test="subclass!= null">
|
|
|
+ subclass,
|
|
|
+ </if>
|
|
|
+ <if test="storelabel!= null">
|
|
|
+ storelabel,
|
|
|
+ </if>
|
|
|
+ <if test="memorySpace!= null">
|
|
|
+ memory_space,
|
|
|
+ </if>
|
|
|
+ <if test="alibaba!= null">
|
|
|
+ alibaba,
|
|
|
+ </if>
|
|
|
+ <if test="qq!= null">
|
|
|
+ qq,
|
|
|
+ </if>
|
|
|
+ <if test="alibabaNick!= null">
|
|
|
+ alibaba_nick,
|
|
|
+ </if>
|
|
|
+ <if test="qqNick!= null">
|
|
|
+ qq_nick,
|
|
|
+ </if>
|
|
|
+ <if test="signing!= null">
|
|
|
+ signing,
|
|
|
+ </if>
|
|
|
+ <if test="albumPrice!= null">
|
|
|
+ album_price,
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag!= null">
|
|
|
+ rate_flag,
|
|
|
+ </if>
|
|
|
+ <if test="orderRate!= null">
|
|
|
+ order_rate,
|
|
|
+ </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="userId != null">
|
|
|
+ #{userId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null">
|
|
|
+ #{storeName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null">
|
|
|
+ #{serviceType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="description != null">
|
|
|
+ #{description,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="icon != null">
|
|
|
+ #{icon,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ #{province,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="citye != null">
|
|
|
+ #{citye,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="district != null">
|
|
|
+ #{district,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null">
|
|
|
+ #{addressDetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null">
|
|
|
+ #{bankCard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null">
|
|
|
+ #{bankName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="openName != null">
|
|
|
+ #{openName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="credit != null">
|
|
|
+ #{credit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null">
|
|
|
+ #{useFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="rank != null">
|
|
|
+ #{rank,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null">
|
|
|
+ #{responseTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null">
|
|
|
+ #{reworkRate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="hotFlag != null">
|
|
|
+ #{hotFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="homeFlag != null">
|
|
|
+ #{homeFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="typeFlag != null">
|
|
|
+ #{typeFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null">
|
|
|
+ #{subclass,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="storelabel != null">
|
|
|
+ #{storelabel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="memorySpace != null">
|
|
|
+ #{memorySpace,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="alibaba != null">
|
|
|
+ #{alibaba,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="qq != null">
|
|
|
+ #{qq,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="alibabaNick != null">
|
|
|
+ #{alibabaNick,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="qqNick != null">
|
|
|
+ #{qqNick,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="signing != null">
|
|
|
+ #{signing,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="albumPrice != null">
|
|
|
+ #{albumPrice},
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag != null">
|
|
|
+ #{rateFlag},
|
|
|
+ </if>
|
|
|
+ <if test="orderRate != null">
|
|
|
+ #{orderRate},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ update store_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="userId != null">
|
|
|
+ user_id= #{userId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ user_name= #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null">
|
|
|
+ store_name= #{storeName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null">
|
|
|
+ service_type= #{serviceType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="description != null">
|
|
|
+ description= #{description,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="icon != null">
|
|
|
+ icon= #{icon,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="province != null">
|
|
|
+ province= #{province,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="citye != null">
|
|
|
+ citye= #{citye,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="district != null">
|
|
|
+ district= #{district,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null">
|
|
|
+ address_detail= #{addressDetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null">
|
|
|
+ bank_card= #{bankCard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null">
|
|
|
+ bank_name= #{bankName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="openName != null">
|
|
|
+ open_name= #{openName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="credit != null">
|
|
|
+ credit= #{credit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null">
|
|
|
+ use_flag= #{useFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="rank != null">
|
|
|
+ rank= #{rank,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null">
|
|
|
+ response_time= #{responseTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null">
|
|
|
+ rework_rate= #{reworkRate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="hotFlag != null">
|
|
|
+ hot_flag= #{hotFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="homeFlag != null">
|
|
|
+ home_flag= #{homeFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="typeFlag != null">
|
|
|
+ type_flag= #{typeFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null">
|
|
|
+ subclass= #{subclass,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="storelabel != null">
|
|
|
+ storelabel= #{storelabel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="memorySpace != null">
|
|
|
+ memory_space= #{memorySpace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="alibaba != null">
|
|
|
+ alibaba = #{alibaba,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="qq != null">
|
|
|
+ qq= #{qq,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="alibabaNick != null">
|
|
|
+ alibaba_nick = #{alibabaNick,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="qqNick != null">
|
|
|
+ qq_nick = #{qqNick,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="signing != null">
|
|
|
+ signing = #{signing,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="albumPrice != null">
|
|
|
+ album_price = #{albumPrice},
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag != null">
|
|
|
+ rate_flag = #{rateFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="orderRate != null">
|
|
|
+ order_rate = #{orderRate},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <sql id="salesSql">
|
|
|
+
|
|
|
+ ,(SELECT SUM(user_order.quantity) FROM user_order WHERE user_order.del_flag='N' AND user_order.store_id = store_info.id) as total_sales,
|
|
|
+ (SELECT SUM(user_order.quantity) FROM user_order WHERE user_order.del_flag='N' AND user_order.store_id = store_info.id AND DATE_FORMAT( user_order.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' ) ) as month_sales
|
|
|
+ </sql>
|
|
|
+ <sql id="companyFlagSql">
|
|
|
+, (
|
|
|
+ SELECT
|
|
|
+ sys_user.company_flag
|
|
|
+ FROM
|
|
|
+ sys_user
|
|
|
+ WHERE
|
|
|
+ sys_user.del_flag = 'N'
|
|
|
+ AND sys_user.id = store_info.user_id
|
|
|
+ ) AS company_flag
|
|
|
+
|
|
|
+ </sql>
|
|
|
+ <sql id="DSRSql">
|
|
|
+
|
|
|
+ ,
|
|
|
+ (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.store_id = store_info.id ) as dsr
|
|
|
+ ,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ SUM(product_info.sales_volume)
|
|
|
+ FROM
|
|
|
+ product_info
|
|
|
+ WHERE
|
|
|
+ product_info.del_flag = 'N'
|
|
|
+ AND product_info.store_id = store_info.id
|
|
|
+ ) as sales_volume
|
|
|
+ ,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ AVG(product_info.price)
|
|
|
+ FROM
|
|
|
+ product_info
|
|
|
+ WHERE
|
|
|
+ product_info.del_flag = 'N'
|
|
|
+ AND product_info.store_id = store_info.id
|
|
|
+ ) as price
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="queryStoreInfoByPage" parameterType="java.util.Map"
|
|
|
+ resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="record.salesFlag != null and !"".equals(record.salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <include refid="DSRSql"/>
|
|
|
+
|
|
|
+ <include refid="companyFlagSql"/>
|
|
|
+
|
|
|
+
|
|
|
+ from store_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <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.userId != null and !"".equals(record.userId)">
|
|
|
+ and user_id = #{record.userId}
|
|
|
+ </if>
|
|
|
+ <if test="record.userName != null and !"".equals(record.userName)">
|
|
|
+ and user_name = #{record.userName}
|
|
|
+ </if>
|
|
|
+ <if test="record.storeName != null and !"".equals(record.storeName)">
|
|
|
+ and store_name = #{record.storeName}
|
|
|
+ </if>
|
|
|
+ <if test="record.serviceType != null and !"".equals(record.serviceType)">
|
|
|
+ and service_type = #{record.serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="record.description != null and !"".equals(record.description)">
|
|
|
+ and description = #{record.description}
|
|
|
+ </if>
|
|
|
+ <if test="record.icon != null and !"".equals(record.icon)">
|
|
|
+ and icon = #{record.icon}
|
|
|
+ </if>
|
|
|
+ <if test="record.province != null and !"".equals(record.province)">
|
|
|
+ and province = #{record.province}
|
|
|
+ </if>
|
|
|
+ <if test="record.citye != null and !"".equals(record.citye)">
|
|
|
+ and citye = #{record.citye}
|
|
|
+ </if>
|
|
|
+ <if test="record.district != null and !"".equals(record.district)">
|
|
|
+ and district = #{record.district}
|
|
|
+ </if>
|
|
|
+ <if test="record.addressDetail != null and !"".equals(record.addressDetail)">
|
|
|
+ and address_detail = #{record.addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="record.bankCard != null and !"".equals(record.bankCard)">
|
|
|
+ and bank_card = #{record.bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="record.bankName != null and !"".equals(record.bankName)">
|
|
|
+ and bank_name = #{record.bankName}
|
|
|
+ </if>
|
|
|
+ <if test="record.openName != null and !"".equals(record.openName)">
|
|
|
+ and open_name = #{record.openName}
|
|
|
+ </if>
|
|
|
+ <if test="record.credit != null and !"".equals(record.credit)">
|
|
|
+ and credit = #{record.credit}
|
|
|
+ </if>
|
|
|
+ <if test="record.useFlag != null and !"".equals(record.useFlag)">
|
|
|
+ and use_flag = #{record.useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.rank != null and !"".equals(record.rank)">
|
|
|
+ and rank = #{record.rank}
|
|
|
+ </if>
|
|
|
+ <if test="record.responseTime != null and !"".equals(record.responseTime)">
|
|
|
+ and response_time = #{record.responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.reworkRate != null and !"".equals(record.reworkRate)">
|
|
|
+ and rework_rate = #{record.reworkRate}
|
|
|
+ </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.typeFlag != null and !"".equals(record.typeFlag)">
|
|
|
+ and type_flag = #{record.typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.signing != null and !"".equals(record.signing)">
|
|
|
+ and signing = #{record.signing}
|
|
|
+ </if>
|
|
|
+ <if test="record.rateFlag != null and !"".equals(record.rateFlag)">
|
|
|
+ and rate_flag = #{record.rateFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.subclass != null and !"".equals(record.subclass)">
|
|
|
+ and subclass = #{record.subclass}
|
|
|
+ </if>
|
|
|
+ <if test="record.companyFlag != null and !"".equals(record.companyFlag)">
|
|
|
+ and user_id in (
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ sys_user
|
|
|
+ WHERE
|
|
|
+ sys_user.del_flag = 'N'
|
|
|
+ AND sys_user.company_flag = #{record.companyFlag}
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ OR user_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR user_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR store_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR service_type LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR description LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR province LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR citye LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR district LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR address_detail LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR bank_card LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR bank_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR open_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR credit LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR use_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR response_time LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR rework_rate LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR hot_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR home_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR type_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR subclass 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="queryAllStoreInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="salesFlag != null and !"".equals(salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+ from store_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="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null and !"".equals(storeName)">
|
|
|
+ and store_name = #{storeName}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="icon != null and !"".equals(icon)">
|
|
|
+ and icon = #{icon}
|
|
|
+ </if>
|
|
|
+ <if test="province != null and !"".equals(province)">
|
|
|
+ and province = #{province}
|
|
|
+ </if>
|
|
|
+ <if test="citye != null and !"".equals(citye)">
|
|
|
+ and citye = #{citye}
|
|
|
+ </if>
|
|
|
+ <if test="district != null and !"".equals(district)">
|
|
|
+ and district = #{district}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null and !"".equals(bankCard)">
|
|
|
+ and bank_card = #{bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null and !"".equals(bankName)">
|
|
|
+ and bank_name = #{bankName}
|
|
|
+ </if>
|
|
|
+ <if test="openName != null and !"".equals(openName)">
|
|
|
+ and open_name = #{openName}
|
|
|
+ </if>
|
|
|
+ <if test="credit != null and !"".equals(credit)">
|
|
|
+ and credit = #{credit}
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
+ and use_flag = #{useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null and !"".equals(responseTime)">
|
|
|
+ and response_time = #{responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null and !"".equals(reworkRate)">
|
|
|
+ and rework_rate = #{reworkRate}
|
|
|
+ </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="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="signing != null and !"".equals(signing)">
|
|
|
+ and signing = #{signing}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="rateFlag != null and !"".equals(rateFlag)">
|
|
|
+ and rate_flag = #{rateFlag}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
+ and subclass = #{subclass}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ OR user_id LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR user_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR store_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR service_type LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR description LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR province LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR citye LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR district LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR address_detail LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR bank_card LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR bank_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR open_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR credit LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR use_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR response_time LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR rework_rate LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR hot_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR home_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR type_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR subclass 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
|
|
|
+ <if test="limitNum != null and !"".equals(limitNum)">
|
|
|
+ LIMIT #{limitNum}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="queryAllStoreInfoForHome" parameterType="java.util.Map"
|
|
|
+ resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="salesFlag != null and !"".equals(salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <include refid="companyFlagSql"/>
|
|
|
+
|
|
|
+ from store_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="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null and !"".equals(storeName)">
|
|
|
+ and store_name = #{storeName}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="icon != null and !"".equals(icon)">
|
|
|
+ and icon = #{icon}
|
|
|
+ </if>
|
|
|
+ <if test="province != null and !"".equals(province)">
|
|
|
+ and province = #{province}
|
|
|
+ </if>
|
|
|
+ <if test="citye != null and !"".equals(citye)">
|
|
|
+ and citye = #{citye}
|
|
|
+ </if>
|
|
|
+ <if test="district != null and !"".equals(district)">
|
|
|
+ and district = #{district}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null and !"".equals(bankCard)">
|
|
|
+ and bank_card = #{bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null and !"".equals(bankName)">
|
|
|
+ and bank_name = #{bankName}
|
|
|
+ </if>
|
|
|
+ <if test="openName != null and !"".equals(openName)">
|
|
|
+ and open_name = #{openName}
|
|
|
+ </if>
|
|
|
+ <if test="credit != null and !"".equals(credit)">
|
|
|
+ and credit = #{credit}
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
+ and use_flag = #{useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null and !"".equals(responseTime)">
|
|
|
+ and response_time = #{responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null and !"".equals(reworkRate)">
|
|
|
+ and rework_rate = #{reworkRate}
|
|
|
+ </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="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="signing != null and !"".equals(signing)">
|
|
|
+ and signing = #{signing}
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag != null and !"".equals(rateFlag)">
|
|
|
+ and rate_flag = #{rateFlag}
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
+ and subclass = #{subclass}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ rank desc , id desc
|
|
|
+ <if test="limitNum != null and !"".equals(limitNum)">
|
|
|
+ LIMIT #{limitNum}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="queryAllStoreInfoForHomeShoreInfo" parameterType="java.util.Map"
|
|
|
+ resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="salesFlag != null and !"".equals(salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+ <include refid="companyFlagSql"/>
|
|
|
+ from store_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ and home_flag = 1
|
|
|
+ and use_flag = 'Y'
|
|
|
+ <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="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null and !"".equals(storeName)">
|
|
|
+ and store_name = #{storeName}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="icon != null and !"".equals(icon)">
|
|
|
+ and icon = #{icon}
|
|
|
+ </if>
|
|
|
+ <if test="province != null and !"".equals(province)">
|
|
|
+ and province = #{province}
|
|
|
+ </if>
|
|
|
+ <if test="citye != null and !"".equals(citye)">
|
|
|
+ and citye = #{citye}
|
|
|
+ </if>
|
|
|
+ <if test="district != null and !"".equals(district)">
|
|
|
+ and district = #{district}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null and !"".equals(bankCard)">
|
|
|
+ and bank_card = #{bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null and !"".equals(bankName)">
|
|
|
+ and bank_name = #{bankName}
|
|
|
+ </if>
|
|
|
+ <if test="openName != null and !"".equals(openName)">
|
|
|
+ and open_name = #{openName}
|
|
|
+ </if>
|
|
|
+ <if test="credit != null and !"".equals(credit)">
|
|
|
+ and credit = #{credit}
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
+ and use_flag = #{useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null and !"".equals(responseTime)">
|
|
|
+ and response_time = #{responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null and !"".equals(reworkRate)">
|
|
|
+ and rework_rate = #{reworkRate}
|
|
|
+ </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="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="signing != null and !"".equals(signing)">
|
|
|
+ and signing = #{signing}
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag != null and !"".equals(rateFlag)">
|
|
|
+ and rate_flag = #{rateFlag}
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
+ and subclass = #{subclass}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ signing desc , rank desc , id desc
|
|
|
+ <if test="limitNum != null and !"".equals(limitNum)">
|
|
|
+ LIMIT #{limitNum}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="queryAllStoreInfoForHomeShoreAndProduct" parameterType="java.util.Map"
|
|
|
+ resultMap="HomeShoreAndProduct">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="salesFlag != null and !"".equals(salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+ <include refid="companyFlagSql"/>
|
|
|
+ from store_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ and home_flag = 1
|
|
|
+ and use_flag = 'Y'
|
|
|
+ <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="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null and !"".equals(storeName)">
|
|
|
+ and store_name = #{storeName}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="icon != null and !"".equals(icon)">
|
|
|
+ and icon = #{icon}
|
|
|
+ </if>
|
|
|
+ <if test="province != null and !"".equals(province)">
|
|
|
+ and province = #{province}
|
|
|
+ </if>
|
|
|
+ <if test="citye != null and !"".equals(citye)">
|
|
|
+ and citye = #{citye}
|
|
|
+ </if>
|
|
|
+ <if test="district != null and !"".equals(district)">
|
|
|
+ and district = #{district}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null and !"".equals(bankCard)">
|
|
|
+ and bank_card = #{bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null and !"".equals(bankName)">
|
|
|
+ and bank_name = #{bankName}
|
|
|
+ </if>
|
|
|
+ <if test="openName != null and !"".equals(openName)">
|
|
|
+ and open_name = #{openName}
|
|
|
+ </if>
|
|
|
+ <if test="credit != null and !"".equals(credit)">
|
|
|
+ and credit = #{credit}
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
+ and use_flag = #{useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null and !"".equals(responseTime)">
|
|
|
+ and response_time = #{responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null and !"".equals(reworkRate)">
|
|
|
+ and rework_rate = #{reworkRate}
|
|
|
+ </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="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="signing != null and !"".equals(signing)">
|
|
|
+ and signing = #{signing}
|
|
|
+ </if>
|
|
|
+ <if test="rateFlag != null and !"".equals(rateFlag)">
|
|
|
+ and rate_flag = #{rateFlag}
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
+ and subclass = #{subclass}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ signing desc , rank desc , id desc
|
|
|
+ <if test="limitNum != null and !"".equals(limitNum)">
|
|
|
+ LIMIT #{limitNum}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="queryStoreInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ <if test="salesFlag != null and !"".equals(salesFlag)">
|
|
|
+ <include refid="salesSql"/>
|
|
|
+ </if>
|
|
|
+ <include refid="companyFlagSql"/>
|
|
|
+ from store_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="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="storeName != null and !"".equals(storeName)">
|
|
|
+ and store_name = #{storeName}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="icon != null and !"".equals(icon)">
|
|
|
+ and icon = #{icon}
|
|
|
+ </if>
|
|
|
+ <if test="province != null and !"".equals(province)">
|
|
|
+ and province = #{province}
|
|
|
+ </if>
|
|
|
+ <if test="citye != null and !"".equals(citye)">
|
|
|
+ and citye = #{citye}
|
|
|
+ </if>
|
|
|
+ <if test="district != null and !"".equals(district)">
|
|
|
+ and district = #{district}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="bankCard != null and !"".equals(bankCard)">
|
|
|
+ and bank_card = #{bankCard}
|
|
|
+ </if>
|
|
|
+ <if test="bankName != null and !"".equals(bankName)">
|
|
|
+ and bank_name = #{bankName}
|
|
|
+ </if>
|
|
|
+ <if test="openName != null and !"".equals(openName)">
|
|
|
+ and open_name = #{openName}
|
|
|
+ </if>
|
|
|
+ <if test="credit != null and !"".equals(credit)">
|
|
|
+ and credit = #{credit}
|
|
|
+ </if>
|
|
|
+ <if test="useFlag != null and !"".equals(useFlag)">
|
|
|
+ and use_flag = #{useFlag}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="responseTime != null and !"".equals(responseTime)">
|
|
|
+ and response_time = #{responseTime}
|
|
|
+ </if>
|
|
|
+ <if test="reworkRate != null and !"".equals(reworkRate)">
|
|
|
+ and rework_rate = #{reworkRate}
|
|
|
+ </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="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ and type_flag = #{typeFlag}
|
|
|
+ </if>
|
|
|
+ <if test="subclass != null and !"".equals(subclass)">
|
|
|
+ and subclass = #{subclass}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <update id="delete">
|
|
|
+ UPDATE store_info SET del_flag = 'Y'
|
|
|
+ <where>
|
|
|
+ AND id = #{id}
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+ <update id="updateUseFlagByUserId">
|
|
|
+ UPDATE store_info
|
|
|
+ <set>
|
|
|
+ <if test="useFlag != null">
|
|
|
+ use_flag= #{useFlag},
|
|
|
+ </if>
|
|
|
+ <if test="typeFlag != null">
|
|
|
+ type_flag= #{typeFlag},
|
|
|
+ </if>
|
|
|
+ <if test="memorySpace != null">
|
|
|
+ memory_space= #{memorySpace},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <where>
|
|
|
+ AND del_flag = 'N'
|
|
|
+ AND user_id = #{userId}
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+ <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from store_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="sameOrLast" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
|
|
|
+ SELECT
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ sys_user
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND DATE_FORMAT(create_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
|
|
|
+ ) AS user_same_month,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ sys_user
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND PERIOD_DIFF(
|
|
|
+ date_format(now(), '%Y%m'),
|
|
|
+ date_format(create_time, '%Y%m')
|
|
|
+ ) = 1
|
|
|
+ ) AS user_last_month,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ store_info
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND DATE_FORMAT(create_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
|
|
|
+ ) AS store_same_month,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ store_info
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND PERIOD_DIFF(
|
|
|
+ date_format(now(), '%Y%m'),
|
|
|
+ date_format(create_time, '%Y%m')
|
|
|
+ ) = 1
|
|
|
+ ) AS store_last_month;
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryStoreInfoReworkRate" resultType="com.izouma.awesomeadmin.model.StoreInfo"
|
|
|
+ parameterType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ ROUND(
|
|
|
+ AVG(
|
|
|
+ (
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ order_repair_detail
|
|
|
+ WHERE
|
|
|
+ repair_id = (
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ `order_repair`
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND order_id = user_order.id
|
|
|
+ AND type_flag = 0
|
|
|
+ LIMIT 1
|
|
|
+ )
|
|
|
+ ) * 0.5 + (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ order_repair_detail
|
|
|
+ WHERE
|
|
|
+ repair_id = (
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ `order_repair`
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND order_id = user_order.id
|
|
|
+ AND type_flag = 1
|
|
|
+ LIMIT 1
|
|
|
+ )
|
|
|
+ ) * 1 + (
|
|
|
+ SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ order_repair_detail
|
|
|
+ WHERE
|
|
|
+ repair_id = (
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ `order_repair`
|
|
|
+ WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+ AND order_id = user_order.id
|
|
|
+ AND type_flag = 2
|
|
|
+ LIMIT 1
|
|
|
+ )
|
|
|
+ ) * 2
|
|
|
+ ) / quantity
|
|
|
+ )*100) AS rework_rate
|
|
|
+FROM
|
|
|
+ `user_order`
|
|
|
+WHERE
|
|
|
+ del_flag = 'N'
|
|
|
+AND store_id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <resultMap id="HomeShoreAndProduct" type="com.izouma.awesomeadmin.model.StoreInfo" extends="BaseResultMap">
|
|
|
+
|
|
|
+
|
|
|
+ <collection property="productInfoList"
|
|
|
+ ofType="com.izouma.awesomeadmin.model.ProductInfo"
|
|
|
+ select="com.izouma.awesomeadmin.dao.ProductInfoMapper.queryAllProductInfoForHome"
|
|
|
+ column="{ storeId = id }"/>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|