fix
Hentua
2023-06-15 8bf923b44bbe9b45b73ddcc25df75c9c59f54e07
src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -95,6 +95,9 @@
                    <if test="record.goodsType == 3">
                        and a.present_price = 0
                    </if>
                    <if test="record.goodsLevel != null">
                        and a.goods_level=#{record.goodsLevel}
                    </if>
                    <if test="record.categoryId != null and record.categoryId != ''">
                        and (c.id = #{record.categoryId} or c.parent_id=#{record.categoryId})
                    </if>
@@ -106,25 +109,23 @@
            group by a.id
            order by a.id desc
        ) a
        <if test="record.sortType != null">
<!--            <if test="record.sortType == 1">-->
<!--                order by a.is_hot, a.saleVolume desc, a.id-->
<!--            </if>-->
            <if test="record.sortType == 1">
                order by a.sort_cnt asc
            </if>
            <if test="record.sortType == 2">
                order by a.saleVolume desc
            </if>
            <if test="record.sortType == 3 and record.sort == 'asc'">
                order by a.price
            </if>
            <if test="record.sortType == 3 and record.sort == 'desc'">
                order by a.price desc
            </if>
            <if test="record.sortType == 4">
                order by a.id desc
            </if>
        <if test="record.sortType == null">
            order by a.sort_cnt asc
        </if>
        <if test="record.sortType == 1">
            order by a.sort_cnt asc
        </if>
        <if test="record.sortType == 2">
            order by a.saleVolume desc
        </if>
        <if test="record.sortType == 3 and record.sort == 'asc'">
            order by a.price
        </if>
        <if test="record.sortType == 3 and record.sort == 'desc'">
            order by a.price desc
        </if>
        <if test="record.sortType == 4">
            order by a.id desc
        </if>
    </select>