Merge branch 'ww' into test
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import lombok.Data;
|
||||
@@ -159,6 +160,8 @@ public class TbShopUser implements Serializable {
|
||||
*/
|
||||
private String dynamic_code;
|
||||
|
||||
private Timestamp joinTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,18 +23,18 @@ public interface TbShopUserFlowMapper extends BaseMapper<TbShopUserFlow> {
|
||||
* @return 用户流水总金额
|
||||
*/
|
||||
@Select("<script>" +
|
||||
" SELECT \n" +
|
||||
" COALESCE(SUM(flow.total_amount), 0) AS chageTotal\n" +
|
||||
"FROM \n" +
|
||||
" tb_shop_user AS a\n" +
|
||||
" LEFT JOIN (\n" +
|
||||
" SELECT shop_user_id, SUM(amount) AS total_amount \n" +
|
||||
" FROM tb_shop_user_flow \n" +
|
||||
" WHERE biz_code IN ('cashMemberIn','scanMemberIn', 'scanMemberAwardIn') \n" +
|
||||
" AND create_time BETWEEN #{startTime} AND #{endTime} \n" +
|
||||
" GROUP BY shop_user_id\n" +
|
||||
" ) AS flow ON flow.shop_user_id = a.id\n" +
|
||||
"WHERE \n" +
|
||||
" SELECT " +
|
||||
" COALESCE(SUM(flow.total_amount), 0) AS chageTotal " +
|
||||
"FROM " +
|
||||
" tb_shop_user AS a " +
|
||||
" LEFT JOIN ( " +
|
||||
" SELECT shop_user_id, SUM(amount) AS total_amount " +
|
||||
" FROM tb_shop_user_flow " +
|
||||
" WHERE biz_code IN ('cashMemberIn','scanMemberIn', 'scanMemberAwardIn') " +
|
||||
" AND create_time BETWEEN #{startTime} AND #{endTime} " +
|
||||
" GROUP BY shop_user_id " +
|
||||
" ) AS flow ON flow.shop_user_id = a.id " +
|
||||
"WHERE " +
|
||||
" a.shop_id = #{shopId}" +
|
||||
"</script>")
|
||||
BigDecimal sumUserFlowAmountByConditions(@Param("shopId") Long shopId,
|
||||
|
||||
Reference in New Issue
Block a user