ResumeDeliverMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.web.work.mapper.ResumeDeliverMapper">
  6. <select id="selectList" resultType="com.ruoyi.web.work.domain.ResumeDeliver">
  7. SELECT
  8. d.*,
  9. p.title,
  10. p.salary,
  11. p.region_name,
  12. p.address,
  13. p.location,
  14. p.longitude,
  15. p.latitude
  16. FROM
  17. tb_resume_deliver d
  18. LEFT JOIN tb_position p ON p.id = d.position_id
  19. <where>
  20. <if test="userId != null "> and d.user_id = #{userId}</if>
  21. <if test="enterpriseId != null "> and d.enterprise_id = #{enterpriseId}</if>
  22. <if test="positionId != null "> and d.position_id = #{positionId}</if>
  23. <if test="state != null "> and d.state = #{state}</if>
  24. <if test="isAccept != null "> and d.is_accept = #{isAccept}</if>
  25. <if test="isRead != null "> and d.is_read = #{isRead}</if>
  26. <if test="isContract != null "> and d.is_contract = #{isContract}</if>
  27. </where>
  28. ORDER BY d.id DESC
  29. </select>
  30. <select id="check" resultType="com.ruoyi.web.work.domain.ResumeDeliver">
  31. SELECT * FROM tb_resume_deliver WHERE position_id=#{positionId} AND user_id=#{userId}
  32. </select>
  33. <select id="receive" resultType="com.ruoyi.web.work.domain.vo.ReceiveVo">
  34. SELECT
  35. p.id,
  36. p.title,
  37. ( SELECT COUNT( d.id ) FROM tb_resume_deliver d WHERE d.position_id = p.id ) AS total,
  38. ( SELECT COUNT( d.id ) FROM tb_resume_deliver d WHERE d.position_id = p.id AND d.is_read = 1 ) AS isRead
  39. FROM
  40. tb_position p
  41. WHERE
  42. p.user_id =#{userId}
  43. GROUP BY
  44. p.id
  45. HAVING
  46. total > 0
  47. ORDER BY total DESC
  48. </select>
  49. <select id="receiveList" resultType="com.ruoyi.web.work.domain.vo.ReceiveListVo">
  50. SELECT
  51. r.name,
  52. r.avatar,
  53. r.sex,
  54. r.age,
  55. r.experience,
  56. d.*
  57. FROM
  58. tb_resume r
  59. LEFT JOIN tb_resume_deliver d ON d.user_id = r.id
  60. WHERE
  61. d.position_id =#{positionId}
  62. AND d.enterprise_id =#{enterpriseId}
  63. <if test="state != null "> and d.state = #{state}</if>
  64. <if test="isAccept != null "> and d.is_accept = #{isAccept}</if>
  65. <if test="isRead != null "> and d.is_read = #{isRead}</if>
  66. <if test="minAge != null and maxAge !=null">AND r.age <![CDATA[ >= ]]> #{minAge} AND r.age <![CDATA[ <= ]]> #{maxAge}</if>
  67. <if test="minExperience != null and maxExperience !=null">AND r.experience <![CDATA[ >= ]]> #{minExperience} AND r.experience <![CDATA[ <= ]]> #{maxExperience}</if>
  68. ORDER BY d.id DESC
  69. </select>
  70. </mapper>