浏览代码

查询全部分类bugfix

chao 4 年之前
父节点
当前提交
1cc60b9524
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      src/main/resources/mapper/ProductTypeMapper.xml

+ 8 - 5
src/main/resources/mapper/ProductTypeMapper.xml

@@ -6,14 +6,17 @@
             bigTypeID as bigTypeId, typeSort, `name`, bigTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
             bigTypeID as bigTypeId, typeSort, `name`, bigTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
         from bigtype
         from bigtype
         where
         where
+            <if test="typeSort == '1' or typeSort == '2'">
+                typeSort = #{typeSort}
+            </if>
+            <if test="typeSort == '0'">
+                typeSort in (1,2)
+            </if>
             <if test="source == 'www'.toString()">
             <if test="source == 'www'.toString()">
-                wwwValidFlag = '1'
+                and wwwValidFlag = '1'
             </if>
             </if>
             <if test="source == 'crm'.toString()">
             <if test="source == 'crm'.toString()">
-                crmValidFlag = '1'
-            </if>
-            <if test="typeSort == '1' or typeSort == '2'">
-                and typeSort = #{typeSort}
+                and crmValidFlag = '1'
             </if>
             </if>
         order by ifnull(sortIndex,10000) , addTime DESC
         order by ifnull(sortIndex,10000) , addTime DESC
     </select>
     </select>