|
@@ -2,13 +2,13 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei.module.product.dao.ProductModuleDao">
|
|
|
<sql id="BigType_Column_List">
|
|
|
- bigTypeID, `name`, bigTypeCode, validFlag, sortIndex, seo, displayOnHomePageFlag
|
|
|
+ bigTypeID, typeSort, `name`, bigTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
|
|
|
</sql>
|
|
|
<sql id="SmallType_Column_List">
|
|
|
- smallTypeID, bigTypeID, `name`, smallTypeCode, validFlag, sortIndex, seo, displayOnHomePageFlag
|
|
|
+ smallTypeID, bigTypeID, `name`, smallTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
|
|
|
</sql>
|
|
|
<sql id="Tinytype_Column_List">
|
|
|
- tinyTypeID, smallTypeID, `name`, tinyTypeCode, icon, validFlag, seo, sortIndex
|
|
|
+ tinyTypeID, smallTypeID, `name`, tinyTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
|
|
|
</sql>
|
|
|
<sql id="Product_Column_List">
|
|
|
productID, brandID, tinyTypeID,productCategory, preferredFlag, selfTypeID, shopID, `name`, aliasName, searchKey, productRemarks,
|
|
@@ -61,29 +61,56 @@
|
|
|
select
|
|
|
<include refid="BigType_Column_List" />
|
|
|
from bigtype
|
|
|
- where validFlag = '1'
|
|
|
+ where
|
|
|
+ typeSort = #{typeSort}
|
|
|
+ <if test="source == 'www'.toString()">
|
|
|
+ and wwwValidFlag = '1'
|
|
|
+ </if>
|
|
|
+ <if test="source == 'crm'.toString()">
|
|
|
+ and crmValidFlag = '1'
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getSmallType" resultType="com.caimei.module.base.entity.vo.SmalltypeVo">
|
|
|
select
|
|
|
<include refid="SmallType_Column_List" />
|
|
|
from smalltype
|
|
|
where bigTypeID = #{bigTypeID,jdbcType=INTEGER}
|
|
|
- and validFlag = '1'
|
|
|
+ <if test="source == 'www'.toString()">
|
|
|
+ and wwwValidFlag = '1'
|
|
|
+ </if>
|
|
|
+ <if test="source == 'crm'.toString()">
|
|
|
+ and crmValidFlag = '1'
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getTinytype" resultType="com.caimei.module.base.entity.vo.TinytypeVo">
|
|
|
select
|
|
|
<include refid="Tinytype_Column_List" />
|
|
|
from tinytype
|
|
|
where smallTypeID = #{smallTypeID,jdbcType=INTEGER}
|
|
|
- and validFlag = '1'
|
|
|
+ <if test="source == 'www'.toString()">
|
|
|
+ and wwwValidFlag = '1'
|
|
|
+ </if>
|
|
|
+ <if test="source == 'crm'.toString()">
|
|
|
+ and crmValidFlag = '1'
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<!-- sortType (3:价格升序, 4:价格降序, 7:人气, 8:销量) -->
|
|
|
- <select id="getProductsByTinyType" resultType="com.caimei.module.base.entity.vo.ProductVo" parameterType="java.lang.Integer">
|
|
|
+ <select id="getProductsByTypeId" resultType="com.caimei.module.base.entity.vo.ProductVo" parameterType="java.lang.Integer">
|
|
|
select
|
|
|
<include refid="Product_Column_List" />
|
|
|
from product
|
|
|
where validFlag = 2
|
|
|
- and tinyTypeID = #{tinyTypeID,jdbcType=INTEGER}
|
|
|
+ <choose>
|
|
|
+ <when test="tinyTypeID != null and tinyTypeID != ''">
|
|
|
+ and tinyTypeID = #{tinyTypeID,jdbcType=INTEGER}
|
|
|
+ </when>
|
|
|
+ <when test="smallTypeID != null and smallTypeID != ''">
|
|
|
+ and smallTypeID = #{smallTypeID,jdbcType=INTEGER}
|
|
|
+ </when>
|
|
|
+ <when test="bigTypeID != null and bigTypeID != ''">
|
|
|
+ and bigTypeID = #{bigTypeID,jdbcType=INTEGER}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
<choose>
|
|
|
<when test="sortType == 3">
|
|
|
order by price1 asc
|