This commit is contained in:
Timi
2026-07-31 15:16:55 +08:00
parent e45809a0db
commit 844c5381c4
13 changed files with 436 additions and 69 deletions
@@ -1,29 +1,51 @@
<?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">
<sql id="searchWhere">
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>
</sql>
<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>
<include refid="searchWhere"/>
ORDER BY `created_at` DESC
</select>
<select id="countSearch" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM `gao_customer`
WHERE
<include refid="searchWhere"/>
</select>
<select id="searchPage" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
SELECT
*
FROM `gao_customer`
WHERE
<include refid="searchWhere"/>
ORDER BY `created_at` DESC
LIMIT #{offset}, #{size}
</select>
<select id="selectInvitedList" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
SELECT
*