12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?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.benyun.core.dao.AttentionPoolDao">
- <resultMap type="com.benyun.core.entity.AttentionPool" id="AttentionPoolResult">
- <result property="attentionId" column="attention_id"/>
- <result property="contact" column="contact"/>
- <result property="telephone" column="telephone"/>
- <result property="brandId" column="brand_id"/>
- <result property="brandName" column="brand_name"/>
- <result property="wdId" column="wd_id"/>
- <result property="wdName" column="wd_name"/>
- <result property="wdAddrInfo" column="wd_addr_info"/>
- <result property="userId" column="user_id"/>
- <result property="attentionTime" column="attention_time"/>
- </resultMap>
- <delete id="deleteByAttentionIdAndUserId">
- delete from `bl_attention_pool`
- <trim prefix="where" prefixOverrides="and">
- <if test="userId != null">
- user_id = #{userId}
- </if>
- and attention_id = #{attentionId}
- </trim>
- </delete>
- <select id="searchByMulti" resultMap="AttentionPoolResult">
- select * from `bl_attention_pool`
- <trim prefix="where" prefixOverrides="and">
- <if test="userId != null">
- user_id = #{userId}
- </if>
- <if test="text != null">
- and (
- contact like concat('%',#{text},'%')
- or telephone like concat('%',#{text},'%')
- or wd_name like concat('%',#{text},'%')
- or wd_addr_info like concat('%',#{text},'%')
- or brand_name like concat('%',#{text},'%')
- )
- </if>
- </trim>
- </select>
- <select id="searchCountByUserId" resultType="java.lang.Integer">
- select count(*) from `bl_attention_pool`
- <where>
- <if test="userId != null">
- user_id = #{userId}
- </if>
- </where>
- </select>
- </mapper>
|