v1.0.3
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user