综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcContractCommentMapper.xml 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.oa.mapper.CmcContractCommentMapper">
  6. <resultMap type="CmcContractComment" id="CmcContractCommentResult">
  7. <result property="commentId" column="comment_id" />
  8. <result property="contractId" column="contract_id" />
  9. <result property="deptId" column="dept_id" />
  10. <result property="userId" column="user_id" />
  11. <result property="comment" column="comment" />
  12. <result property="document" column="document" />
  13. <result property="commentTime" column="comment_time" />
  14. <association property="commentUser" javaType="SysUser" resultMap="CommentUserResult" />
  15. </resultMap>
  16. <resultMap type="SysUser" id="CommentUserResult">
  17. <result property="userId" column="user_id" />
  18. <result property="nickName" column="nick_name" />
  19. </resultMap>
  20. <sql id="selectCmcContractCommentVo">
  21. select cc.comment_id, cc.contract_id, cc.dept_id, cc.user_id, u.nick_name, cc.comment, cc.document, cc.comment_time from cmc_contract_comment as cc
  22. left join sys_user as u on u.user_id = cc.user_id
  23. </sql>
  24. <select id="selectCmcContractCommentList" parameterType="CmcContractComment" resultMap="CmcContractCommentResult">
  25. <include refid="selectCmcContractCommentVo"/>
  26. <where>
  27. <if test="contractId != null and contractId != ''"> and contract_id like concat('%', #{contractId}, '%')</if>
  28. <if test="deptId != null "> and dept_id = #{deptId}</if>
  29. <if test="userId != null "> and user_id = #{userId}</if>
  30. <if test="comment != null and comment != ''"> and comment = #{comment}</if>
  31. <if test="document != null and document != ''"> and document = #{document}</if>
  32. <if test="commentTime != null "> and comment_time = #{commentTime}</if>
  33. </where>
  34. </select>
  35. <select id="selectCmcContractCommentByContractId" parameterType="String" resultMap="CmcContractCommentResult">
  36. <include refid="selectCmcContractCommentVo"/>
  37. where cc.contract_id = #{contractId}
  38. </select>
  39. <insert id="insertCmcContractComment" parameterType="CmcContractComment">
  40. insert into cmc_contract_comment
  41. <trim prefix="(" suffix=")" suffixOverrides=",">
  42. <if test="commentId != null">comment_id,</if>
  43. <if test="contractId != null">contract_id,</if>
  44. <if test="deptId != null">dept_id,</if>
  45. <if test="userId != null">user_id,</if>
  46. <if test="comment != null">comment,</if>
  47. <if test="document != null">document,</if>
  48. <if test="commentTime != null">comment_time,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="commentId != null">#{commentId},</if>
  52. <if test="contractId != null">#{contractId},</if>
  53. <if test="deptId != null">#{deptId},</if>
  54. <if test="userId != null">#{userId},</if>
  55. <if test="comment != null">#{comment},</if>
  56. <if test="document != null">#{document},</if>
  57. <if test="commentTime != null">#{commentTime},</if>
  58. </trim>
  59. </insert>
  60. <update id="updateCmcContractComment" parameterType="CmcContractComment">
  61. update cmc_contract_comment
  62. <trim prefix="SET" suffixOverrides=",">
  63. <if test="contractId != null">contract_id = #{contractId},</if>
  64. <if test="deptId != null">dept_id = #{deptId},</if>
  65. <if test="userId != null">user_id = #{userId},</if>
  66. <if test="comment != null">comment = #{comment},</if>
  67. <if test="document != null">document = #{document},</if>
  68. <if test="commentTime != null">comment_time = #{commentTime},</if>
  69. </trim>
  70. where comment_id = #{commentId}
  71. </update>
  72. <delete id="deleteCmcContractCommentByContractId" parameterType="String">
  73. delete from cmc_contract_comment where contract_id = #{contractId}
  74. </delete>
  75. <delete id="deleteCmcContractCommentByContractIds" parameterType="String">
  76. delete from cmc_contract_comment where contract_id in
  77. <foreach item="contractId" collection="array" open="(" separator="," close=")">
  78. #{contractId}
  79. </foreach>
  80. </delete>
  81. </mapper>