v1.0.5
This commit is contained in:
@@ -28,6 +28,18 @@
|
||||
ORDER BY `created_at` DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByIdList" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
|
||||
SELECT
|
||||
*
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`id` IN
|
||||
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<select id="countSearch" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
@@ -65,6 +77,16 @@
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<update id="updateInvitedCountDelta">
|
||||
UPDATE `gao_customer`
|
||||
SET
|
||||
`invited_count` = GREATEST(IFNULL(`invited_count`, 0) + #{delta}, 0),
|
||||
`updated_at` = UNIX_TIMESTAMP() * 1000
|
||||
WHERE
|
||||
`id` = #{customerId}
|
||||
AND `deleted_at` IS NULL
|
||||
</update>
|
||||
|
||||
<select id="statDailyNewCustomer" resultType="com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStatView">
|
||||
SELECT
|
||||
CAST(DATE_FORMAT(FROM_UNIXTIME(`created_at` / 1000), '%Y%m%d') AS UNSIGNED) AS `dateValue`,
|
||||
@@ -86,4 +108,14 @@
|
||||
`created_at` < #{beginCreatedAt}
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<select id="statGender" resultType="com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView">
|
||||
SELECT
|
||||
IFNULL(CAST(`gender` AS CHAR), 'UNKNOWN') AS `genderCode`,
|
||||
COUNT(1) AS `count`
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`deleted_at` IS NULL
|
||||
GROUP BY IFNULL(CAST(`gender` AS CHAR), 'UNKNOWN')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user