WaitRemindMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.system.mapper.WaitRemindMapper">
  6. <resultMap type="WaitRemind" id="WaitRemindResult">
  7. <result property="remindId" column="remind_id" />
  8. <result property="loanApplicationId" column="loan_application_id" />
  9. <result property="loanApplicationNumber" column="loan_application_number" />
  10. <result property="remindTitle" column="remind_title" />
  11. <result property="remindType" column="remind_type" />
  12. <result property="remindContent" column="remind_content" />
  13. <result property="remindTime" column="remind_time" />
  14. <result property="readUserId" column="read_user_id" />
  15. <result property="isRead" column="is_read" />
  16. <result property="status" column="status" />
  17. <result property="createBy" column="create_by" />
  18. <result property="createTime" column="create_time" />
  19. <result property="updateBy" column="update_by" />
  20. <result property="updateTime" column="update_time" />
  21. <result property="remark" column="remark" />
  22. </resultMap>
  23. <sql id="selectWaitRemindVo">
  24. select remind_id, loan_application_id, loan_application_number, remind_title, remind_type, remind_content, remind_time, read_user_id, is_read, status, create_by, create_time, update_by, update_time, remark from wait_remind
  25. </sql>
  26. <select id="selectWaitRemindList" parameterType="WaitRemind" resultMap="WaitRemindResult">
  27. <include refid="selectWaitRemindVo"/>
  28. <where>
  29. <if test="loanApplicationId != null "> and loan_application_id = #{loanApplicationId}</if>
  30. <if test="loanApplicationNumber != null and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
  31. <if test="remindTitle != null and remindTitle != ''"> and remind_title = #{remindTitle}</if>
  32. <if test="remindType != null and remindType != ''"> and remind_type = #{remindType}</if>
  33. <if test="remindContent != null and remindContent != ''"> and remind_content = #{remindContent}</if>
  34. <if test="remindTime != null "> and remind_time = #{remindTime}</if>
  35. <if test="readUserId != null and readUserId != ''"> and read_user_id = #{readUserId}</if>
  36. <if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
  37. <if test="status != null and status != ''"> and status = #{status}</if>
  38. </where>
  39. order by remind_time DESC
  40. </select>
  41. <select id="selectWaitRemindByRemindId" parameterType="Integer" resultMap="WaitRemindResult">
  42. <include refid="selectWaitRemindVo"/>
  43. where remind_id = #{remindId}
  44. </select>
  45. <select id="selectWaitRemindByLoanApplicationId" parameterType = "Long" resultMap="WaitRemindResult">
  46. <include refid="selectWaitRemindVo"/>
  47. where loan_application_id = #{loanApplicationId} and remind_type = '12'
  48. </select>
  49. <insert id="insertWaitRemind" parameterType="WaitRemind" useGeneratedKeys="true" keyProperty="remindId">
  50. insert into wait_remind
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="loanApplicationId != null">loan_application_id,</if>
  53. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">loan_application_number,</if>
  54. <if test="remindTitle != null and remindTitle != ''">remind_title,</if>
  55. <if test="remindType != null and remindType != ''">remind_type,</if>
  56. <if test="remindContent != null">remind_content,</if>
  57. <if test="remindTime != null">remind_time,</if>
  58. <if test="readUserId != null and readUserId != ''">read_user_id,</if>
  59. <if test="isRead != null">is_read,</if>
  60. <if test="status != null">status,</if>
  61. <if test="createBy != null">create_by,</if>
  62. <if test="createTime != null">create_time,</if>
  63. <if test="updateBy != null">update_by,</if>
  64. <if test="updateTime != null">update_time,</if>
  65. <if test="remark != null">remark,</if>
  66. </trim>
  67. <trim prefix="values (" suffix=")" suffixOverrides=",">
  68. <if test="loanApplicationId != null">#{loanApplicationId},</if>
  69. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">#{loanApplicationNumber},</if>
  70. <if test="remindTitle != null and remindTitle != ''">#{remindTitle},</if>
  71. <if test="remindType != null and remindType != ''">#{remindType},</if>
  72. <if test="remindContent != null">#{remindContent},</if>
  73. <if test="remindTime != null">#{remindTime},</if>
  74. <if test="readUserId != null and readUserId != ''">#{readUserId},</if>
  75. <if test="isRead != null">#{isRead},</if>
  76. <if test="status != null">#{status},</if>
  77. <if test="createBy != null">#{createBy},</if>
  78. <if test="createTime != null">#{createTime},</if>
  79. <if test="updateBy != null">#{updateBy},</if>
  80. <if test="updateTime != null">#{updateTime},</if>
  81. <if test="remark != null">#{remark},</if>
  82. </trim>
  83. </insert>
  84. <insert id="batchWaitRemind">
  85. insert into wait_remind(loan_application_id, loan_application_number, remind_title, remind_type, remind_content,remind_time,
  86. read_user_id,status, create_time) values
  87. <foreach item="item" index="index" collection="list" separator=",">
  88. (#{item.loanApplicationId},#{item.loanApplicationNumber},#{item.remindTitle},#{item.remindType},#{item.remindContent},#{item.remindTime},#{item.readUserId},#{item.status},sysdate())
  89. </foreach>
  90. </insert>
  91. <update id="updateWaitRemind" parameterType="WaitRemind">
  92. update wait_remind
  93. <trim prefix="SET" suffixOverrides=",">
  94. <if test="loanApplicationId != null">loan_application_id = #{loanApplicationId},</if>
  95. <if test="loanApplicationNumber != null and loanApplicationNumber != ''">loan_application_number = #{loanApplicationNumber},</if>
  96. <if test="remindTitle != null and remindTitle != ''">remind_title = #{remindTitle},</if>
  97. <if test="remindType != null and remindType != ''">remind_type = #{remindType},</if>
  98. <if test="remindContent != null">remind_content = #{remindContent},</if>
  99. <if test="remindTime != null">remind_time = #{remindTime},</if>
  100. <if test="readUserId != null and readUserId != ''">read_user_id = #{readUserId},</if>
  101. <if test="isRead != null">is_read = #{isRead},</if>
  102. <if test="status != null">status = #{status},</if>
  103. <if test="createBy != null">create_by = #{createBy},</if>
  104. <if test="createTime != null">create_time = #{createTime},</if>
  105. <if test="updateBy != null">update_by = #{updateBy},</if>
  106. <if test="updateTime != null">update_time = #{updateTime},</if>
  107. <if test="remark != null">remark = #{remark},</if>
  108. </trim>
  109. where remind_id = #{remindId}
  110. </update>
  111. <delete id="deleteWaitRemindByRemindId" parameterType="Integer">
  112. delete from wait_remind where remind_id = #{remindId}
  113. </delete>
  114. <delete id="deleteWaitRemindByRemindIds" parameterType="String">
  115. delete from wait_remind where remind_id in
  116. <foreach item="remindId" collection="array" open="(" separator="," close=")">
  117. #{remindId}
  118. </foreach>
  119. </delete>
  120. <delete id="deleteWaitRemindByReadUserId" parameterType="WaitRemind">
  121. delete from wait_remind where loan_application_id = #{loanApplicationId} and read_user_id = #{readUserId}
  122. </delete>
  123. </mapper>