add customer order map
This commit is contained in:
@@ -55,5 +55,5 @@ public interface GaoCustomerMapper extends BaseMapper<GaoCustomer, String> {
|
|||||||
/// @param customerId 客户 ID
|
/// @param customerId 客户 ID
|
||||||
/// @param delta 变化量
|
/// @param delta 变化量
|
||||||
@Update("UPDATE `gao_customer` SET `invited_count` = GREATEST(IFNULL(`invited_count`, 0) + #{delta}, 0), `updated_at` = " + UNIX_TIME + " WHERE `id` = #{customerId}" + NOT_DELETE)
|
@Update("UPDATE `gao_customer` SET `invited_count` = GREATEST(IFNULL(`invited_count`, 0) + #{delta}, 0), `updated_at` = " + UNIX_TIME + " WHERE `id` = #{customerId}" + NOT_DELETE)
|
||||||
void updateInvitedCountDelta(@Param("customerId") String customerId, @Param("delta") Long delta);
|
void updateInvitedCountDelta(String customerId, Long delta);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.vo;
|
package com.imyeyu.api.modules.gao.vo;
|
||||||
|
|
||||||
import com.imyeyu.java.bean.BasePage;
|
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
||||||
|
import com.imyeyu.spring.bean.Page;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ import java.util.List;
|
|||||||
/// @since 2026-08-13
|
/// @since 2026-08-13
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class GaoCustomerPage extends BasePage {
|
public class GaoCustomerPage extends Page<GaoCustomer> {
|
||||||
|
|
||||||
/// 门店 ID
|
/// 门店 ID
|
||||||
private String storeId;
|
private String storeId;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
</if>
|
</if>
|
||||||
AND `deleted_at` IS NULL
|
AND `deleted_at` IS NULL
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="queryWhere">
|
<sql id="queryWhere">
|
||||||
`c`.`deleted_at` IS NULL
|
`c`.`deleted_at` IS NULL
|
||||||
<if test="storeId != null and storeId != ''">
|
<if test="storeId != null and storeId != ''">
|
||||||
@@ -64,7 +63,18 @@
|
|||||||
FROM `gao_customer` `c`
|
FROM `gao_customer` `c`
|
||||||
WHERE
|
WHERE
|
||||||
<include refid="queryWhere"/>
|
<include refid="queryWhere"/>
|
||||||
|
<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
|
ORDER BY `c`.`created_at` DESC, `c`.`id` DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
LIMIT #{offset}, #{limit}
|
LIMIT #{offset}, #{limit}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user