v1.0.13
This commit is contained in:
@@ -19,6 +19,52 @@
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<sql id="queryWhere">
|
||||
`c`.`deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">
|
||||
AND `c`.`store_id` = #{storeId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
`c`.`code` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `c`.`name` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `c`.`telephone` LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="tagIdList != null and !tagIdList.isEmpty()">
|
||||
<bind name="tagCount" value="tagIdList.size()"/>
|
||||
AND `c`.`id` IN (
|
||||
SELECT `ta`.`biz_id`
|
||||
FROM `tag_apply` `ta`
|
||||
WHERE
|
||||
`ta`.`biz_type` = 'GAO_CUSTOMER'
|
||||
AND `ta`.`tag_id` IN
|
||||
<foreach collection="tagIdList" item="tagId" separator="," open="(" close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
AND `ta`.`deleted_at` IS NULL
|
||||
GROUP BY `ta`.`biz_id`
|
||||
HAVING COUNT(DISTINCT `ta`.`tag_id`) = #{tagCount}
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="countByQuery" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM `gao_customer` `c`
|
||||
WHERE
|
||||
<include refid="queryWhere"/>
|
||||
</select>
|
||||
|
||||
<select id="selectByQuery" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
|
||||
SELECT `c`.*
|
||||
FROM `gao_customer` `c`
|
||||
WHERE
|
||||
<include refid="queryWhere"/>
|
||||
ORDER BY `c`.`created_at` DESC, `c`.`id` DESC
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="stateDailyNewCustomer" resultType="com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView">
|
||||
SELECT
|
||||
CAST(DATE_FORMAT(FROM_UNIXTIME(`created_at` / 1000), '%Y%m%d') AS UNSIGNED) AS `dateValue`,
|
||||
|
||||
Reference in New Issue
Block a user