v1.0.39 #51
@@ -55,5 +55,5 @@ public interface GaoCustomerMapper extends BaseMapper<GaoCustomer, String> {
|
||||
/// @param customerId 客户 ID
|
||||
/// @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)
|
||||
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;
|
||||
|
||||
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.EqualsAndHashCode;
|
||||
|
||||
@@ -12,7 +13,7 @@ import java.util.List;
|
||||
/// @since 2026-08-13
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GaoCustomerPage extends BasePage {
|
||||
public class GaoCustomerPage extends Page<GaoCustomer> {
|
||||
|
||||
/// 门店 ID
|
||||
private String storeId;
|
||||
|
||||
@@ -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