1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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.BusinessOpportunitiesDao">
- <resultMap type="com.benyun.core.entity.BusinessOpportunitiesClue" id="ClueResult">
- <result property="clueId" column="clue_id"/>
- <result property="attentionId" column="attention_id"/>
- <result property="contact" column="contact"/>
- <result property="telephone" column="telephone"/>
- <result property="followUpCount" column="follow_up_count"/>
- <result property="userId" column="user_id"/>
- <result property="createTime" column="create_time"/>
- </resultMap>
- <update id="updateFollowUpCountByClueIdAndUserId">
- UPDATE `bl_business_opportunities_clue`
- SET follow_up_count = #{count}
- <trim prefix="where" prefixOverrides="and">
- <if test="userId != null">
- user_id = #{userId}
- </if>
- and clue_id = #{clueId}
- </trim>
- </update>
- <delete id="deleteByAttentionIdAndUserId">
- delete from `bl_business_opportunities_clue`
- <trim prefix="where" prefixOverrides="and">
- <if test="userId != null">
- user_id = #{userId}
- </if>
- and attention_id = #{attentionId}
- </trim>
- </delete>
- <select id="searchCountByUserId" resultType="java.lang.Integer">
- select count(*) from `bl_business_opportunities_clue`
- <where>
- <if test="userId != null">
- user_id = #{userId}
- </if>
- </where>
- </select>
- <select id="searchByClueIdOrAttentionIdAndUserId" resultMap="ClueResult">
- select * from `bl_business_opportunities_clue`
- <trim prefix="where" prefixOverrides="and">
- <if test="userId != null">
- user_id = #{userId}
- </if>
- <if test="clueId != null">
- and clue_id = #{clueId}
- </if>
- <if test="attentionId != null">
- and attention_id = #{attentionId}
- </if>
- </trim>
- </select>
- <select id="searchAllByMulti" resultMap="ClueResult">
- select * from `bl_business_opportunities_clue`
- <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},'%'))
- </if>
- </trim>
- </select>
- </mapper>
|