|
@@ -14,7 +14,9 @@
|
|
AND delFlag = '0'
|
|
AND delFlag = '0'
|
|
ORDER BY
|
|
ORDER BY
|
|
IF(ISNULL(sort),1,0) ASC,
|
|
IF(ISNULL(sort),1,0) ASC,
|
|
- sort ASC
|
|
|
|
|
|
+ sort ASC,
|
|
|
|
+ addTime DESC,
|
|
|
|
+ id DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findProducts" resultType="com.caimei.entity.CmOrganizeProducts" parameterType="int">
|
|
<select id="findProducts" resultType="com.caimei.entity.CmOrganizeProducts" parameterType="int">
|
|
@@ -35,7 +37,9 @@
|
|
AND p.productID IS NOT NULL
|
|
AND p.productID IS NOT NULL
|
|
ORDER BY
|
|
ORDER BY
|
|
IF(ISNULL(cop.commonlyProductSort),1,0) ASC,
|
|
IF(ISNULL(cop.commonlyProductSort),1,0) ASC,
|
|
- cop.commonlyProductSort ASC
|
|
|
|
|
|
+ cop.commonlyProductSort ASC,
|
|
|
|
+ cop.addTime DESC,
|
|
|
|
+ cop.id DESC
|
|
LIMIT
|
|
LIMIT
|
|
5
|
|
5
|
|
</select>
|
|
</select>
|
|
@@ -74,7 +78,8 @@
|
|
AND cmop.delFlag = '0'
|
|
AND cmop.delFlag = '0'
|
|
AND p.productID IS NOT NULL
|
|
AND p.productID IS NOT NULL
|
|
ORDER BY
|
|
ORDER BY
|
|
- cmop.addTime DESC
|
|
|
|
|
|
+ cmop.addTime DESC,
|
|
|
|
+ cmop.id DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="preferred" parameterType="int" resultType="com.caimei.entity.CmOrganizeProducts">
|
|
<select id="preferred" parameterType="int" resultType="com.caimei.entity.CmOrganizeProducts">
|
|
@@ -103,15 +108,15 @@
|
|
</where>
|
|
</where>
|
|
<if test="preferredProduct != null and preferredProduct != ''">
|
|
<if test="preferredProduct != null and preferredProduct != ''">
|
|
ORDER BY IF(ISNULL(cmop.preferredProductSort),1,0) ASC,
|
|
ORDER BY IF(ISNULL(cmop.preferredProductSort),1,0) ASC,
|
|
- cmop.preferredProductSort ASC,cmop.addTime DESC
|
|
|
|
|
|
+ cmop.preferredProductSort ASC,cmop.addTime DESC,cmop.id DESC
|
|
</if>
|
|
</if>
|
|
<if test="commonlyProduct != null and commonlyProduct != ''">
|
|
<if test="commonlyProduct != null and commonlyProduct != ''">
|
|
ORDER BY IF(ISNULL(cmop.commonlyProductSort),1,0) ASC,
|
|
ORDER BY IF(ISNULL(cmop.commonlyProductSort),1,0) ASC,
|
|
- cmop.commonlyProductSort ASC,cmop.addTime DESC
|
|
|
|
|
|
+ cmop.commonlyProductSort ASC,cmop.addTime DESC,cmop.id DESC
|
|
</if>
|
|
</if>
|
|
<if test="preferentialProduct != null and preferentialProduct != ''">
|
|
<if test="preferentialProduct != null and preferentialProduct != ''">
|
|
ORDER BY IF(ISNULL(cmop.preferentialProductSort),1,0) ASC,
|
|
ORDER BY IF(ISNULL(cmop.preferentialProductSort),1,0) ASC,
|
|
- cmop.preferentialProductSort ASC,cmop.addTime DESC
|
|
|
|
|
|
+ cmop.preferentialProductSort ASC,cmop.addTime DESC,cmop.id DESC
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
|