add customer order map
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user