add customer order map

This commit is contained in:
Timi
2026-09-10 14:09:30 +08:00
parent 66c13062b2
commit 7b08641acc
3 changed files with 16 additions and 5 deletions
@@ -18,7 +18,6 @@
</if>
AND `deleted_at` IS NULL
</select>
<sql id="queryWhere">
`c`.`deleted_at` IS NULL
<if test="storeId != null and storeId != ''">
@@ -64,7 +63,18 @@
FROM `gao_customer` `c`
WHERE
<include refid="queryWhere"/>
ORDER BY `c`.`created_at` DESC, `c`.`id` DESC
<choose>
<when test="orderMap != null and !orderMap.isEmpty()">
ORDER BY
<foreach collection="orderMap" index="key" item="value" separator=",">
<bind name="underscoreKey" value="@com.imyeyu.utils.Text@camelCase2underscore(key)"/>
${underscoreKey} ${value}
</foreach>
</when>
<otherwise>
ORDER BY `c`.`created_at` DESC, `c`.`id` DESC
</otherwise>
</choose>
LIMIT #{offset}, #{limit}
</select>