add store

This commit is contained in:
Timi
2026-08-07 11:37:54 +08:00
parent 7ffdd715ee
commit 7e40e0202e
60 changed files with 1657 additions and 446 deletions
@@ -6,10 +6,16 @@
*
FROM `gao_customer`
WHERE
`id` IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
TRUE
<if test="idList != null and !idList.isEmpty()">
AND `id` IN
<foreach collection="idList" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
<if test="idList == null or idList.isEmpty()">
AND FALSE
</if>
AND `deleted_at` IS NULL
</select>
@@ -19,7 +25,8 @@
COUNT(1) AS `newCustomerCount`
FROM `gao_customer`
WHERE
`created_at` >= #{beginCreatedAt}
`store_id` = #{storeId}
AND `created_at` >= #{beginCreatedAt}
AND `created_at` &lt;= #{endCreatedAt}
AND `deleted_at` IS NULL
GROUP BY DATE_FORMAT(FROM_UNIXTIME(`created_at` / 1000), '%Y%m%d')
@@ -31,7 +38,8 @@
COUNT(1)
FROM `gao_customer`
WHERE
`created_at` &lt; #{beginCreatedAt}
`store_id` = #{storeId}
AND `created_at` &lt; #{beginCreatedAt}
AND `deleted_at` IS NULL
</select>
@@ -41,7 +49,8 @@
COUNT(1) AS `count`
FROM `gao_customer`
WHERE
`deleted_at` IS NULL
`store_id` = #{storeId}
AND `deleted_at` IS NULL
GROUP BY IFNULL(CAST(`gender` AS CHAR), 'UNKNOWN')
</select>
</mapper>