FollowUpMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.demo.mapper.FollowUpDao">
  6. <resultMap type="com.ruoyi.demo.entity.FollowUpRecord" id="RecoredResult">
  7. <result property="recordId" column="record_id"/>
  8. <result property="clueId" column="clue_id"/>
  9. <result property="followWay" column="follow_way"/>
  10. <result property="followContent" column="follow_content"/>
  11. <result property="followPerson" column="follow_person"/>
  12. <result property="userId" column="user_id"/>
  13. <result property="followTime" column="follow_time"/>
  14. </resultMap>
  15. <delete id="deleteByClueIdAndUserId">
  16. delete from `bl_follow_up_record`
  17. <trim prefix="where" prefixOverrides="and">
  18. <if test="userId != null">
  19. user_id = #{userId}
  20. </if>
  21. and clue_id = #{clueId}
  22. </trim>
  23. </delete>
  24. <select id="searchCountByUserIdAndWay" resultType="java.lang.Integer">
  25. select count(*) from `bl_follow_up_record`
  26. <trim prefix="where" prefixOverrides="and">
  27. <if test="userId != null">
  28. user_id = #{userId}
  29. </if>
  30. and follow_way = #{way}
  31. </trim>
  32. </select>
  33. <select id="searchAllByClueIdAndUserId" resultMap="RecoredResult">
  34. select * from `bl_follow_up_record`
  35. <trim prefix="where" prefixOverrides="and">
  36. <if test="userId != null">
  37. user_id = #{userId}
  38. </if>
  39. and clue_id = #{clueId}
  40. </trim>
  41. </select>
  42. <select id="searchAllByMulti" resultMap="RecoredResult">
  43. select * from `bl_follow_up_record`
  44. <trim prefix="where" prefixOverrides="and">
  45. <if test="userId != null">
  46. user_id = #{userId}
  47. </if>
  48. and clue_id = #{clueId}
  49. <if test="text != null">
  50. and (record_id like concat('%',#{text},'%')
  51. or follow_content like concat('%',#{text},'%')
  52. or follow_person like concat('%',#{text},'%'))
  53. </if>
  54. <if test="startTime != null">
  55. and #{startTime} <![CDATA[<=]]> follow_time
  56. </if>
  57. <if test="endTime != null">
  58. and follow_time <![CDATA[<=]]> #{endTime}
  59. </if>
  60. </trim>
  61. </select>
  62. </mapper>