| <?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.mzl.flower.mapper.partner.PartnerMapper"> | 
|   | 
|     <select id="queryPartner" resultType="com.mzl.flower.dto.response.partner.PartnerDTO"> | 
|         select * from t_partner_info t where t.deleted= 0 | 
|         <if test="dto.name!=null and dto.name!=''"> | 
|             AND t.name LIKE CONCAT('%',#{dto.name}, '%') | 
|         </if> | 
|         <if test="dto.tel!=null and dto.tel!=''"> | 
|             AND t.contact_tel LIKE CONCAT('%',#{dto.tel}, '%') | 
|         </if> | 
|         <if test="dto.status!=null and dto.status!=''"> | 
|             AND t.status = #{dto.status} | 
|         </if> | 
|         <if test="dto.createDateBegin!=null "> | 
|             <![CDATA[ | 
|                AND t.create_time >= #{dto.createDateBegin} | 
|             ]]> | 
|         </if> | 
|         <if test="dto.createDateEnd!=null "> | 
|             <![CDATA[ | 
|                AND t.create_time <= #{dto.createDateEnd} | 
|             ]]> | 
|         </if> | 
|         <if test="dto.province!=null and dto.province!=''"> | 
|             AND t.province like CONCAT('%',#{dto.province}, '%') | 
|         </if> | 
|         <if test="dto.city!=null and dto.city!=''"> | 
|             AND t.city like CONCAT('%',#{dto.city}, '%') | 
|         </if> | 
|         <if test="dto.region!=null and dto.region!=''"> | 
|             AND t.region like CONCAT('%',#{dto.region}, '%') | 
|         </if> | 
|         order by t.create_time desc | 
|     </select> | 
|     <select id="getCurrentPartner" resultType="com.mzl.flower.dto.response.partner.PartnerDTO" | 
|             parameterType="java.lang.String"> | 
|         select * from t_partner_info t where t.deleted= 0 AND t.user_id = #{userId} | 
|     </select> | 
|     <select id="getByIdOrUserId" resultType="com.mzl.flower.entity.partner.Partner" | 
|             parameterType="java.lang.String"> | 
|         select * from t_partner_info t where t.deleted= 0 AND (t.id = #{partnerUserId} or t.user_id = #{partnerUserId}) | 
|     </select> | 
| </mapper> |