refactor all
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.imyeyu.api.modules.gao.mapper.GaoCustomerMapper">
|
||||
<select id="search" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
|
||||
SELECT
|
||||
*
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
1 = 1
|
||||
AND `deleted_at` IS NULL
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
`code` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `name` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `telephone` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `address` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR `disease` LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR CAST(`conditioning_part` AS CHAR) LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="introducerCustomerId != null and introducerCustomerId != ''">
|
||||
AND `introducer_customer_id` = #{introducerCustomerId}
|
||||
</if>
|
||||
ORDER BY `created_at` DESC
|
||||
</select>
|
||||
|
||||
<select id="selectInvitedList" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
|
||||
SELECT
|
||||
*
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`introducer_customer_id` = #{introducerCustomerId}
|
||||
AND `deleted_at` IS NULL
|
||||
ORDER BY `created_at` DESC
|
||||
</select>
|
||||
|
||||
<select id="countInvited" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`introducer_customer_id` = #{introducerCustomerId}
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<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`,
|
||||
COUNT(1) AS `newCustomerCount`
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`created_at` >= #{beginCreatedAt}
|
||||
AND `created_at` <= #{endCreatedAt}
|
||||
AND `deleted_at` IS NULL
|
||||
GROUP BY DATE_FORMAT(FROM_UNIXTIME(`created_at` / 1000), '%Y%m%d')
|
||||
ORDER BY `dateValue` ASC
|
||||
</select>
|
||||
|
||||
<select id="countCreatedBefore" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM `gao_customer`
|
||||
WHERE
|
||||
`created_at` < #{beginCreatedAt}
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user