综合办公系统
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CmcContractCommentMapper.xml 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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="commentTime" column="comment_time" />
  13. </resultMap>
  14. <sql id="selectCmcContractCommentVo">
  15. select comment_id, contract_id, dept_id, user_id, comment, comment_time from cmc_contract_comment
  16. </sql>
  17. <select id="selectCmcContractCommentList" parameterType="CmcContractComment" resultMap="CmcContractCommentResult">
  18. <include refid="selectCmcContractCommentVo"/>
  19. <where>
  20. <if test="contractId != null and contractId != ''"> and contract_id like concat('%', #{contractId}, '%')</if>
  21. <if test="deptId != null "> and dept_id = #{deptId}</if>
  22. <if test="userId != null "> and user_id = #{userId}</if>
  23. <if test="comment != null and comment != ''"> and comment = #{comment}</if>
  24. <if test="commentTime != null "> and comment_time = #{commentTime}</if>
  25. </where>
  26. </select>
  27. <select id="selectCmcContractCommentByCommentId" parameterType="String" resultMap="CmcContractCommentResult">
  28. <include refid="selectCmcContractCommentVo"/>
  29. where comment_id = #{commentId}
  30. </select>
  31. <insert id="insertCmcContractComment" parameterType="CmcContractComment">
  32. insert into cmc_contract_comment
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="commentId != null">comment_id,</if>
  35. <if test="contractId != null">contract_id,</if>
  36. <if test="deptId != null">dept_id,</if>
  37. <if test="userId != null">user_id,</if>
  38. <if test="comment != null">comment,</if>
  39. <if test="commentTime != null">comment_time,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="commentId != null">#{commentId},</if>
  43. <if test="contractId != null">#{contractId},</if>
  44. <if test="deptId != null">#{deptId},</if>
  45. <if test="userId != null">#{userId},</if>
  46. <if test="comment != null">#{comment},</if>
  47. <if test="commentTime != null">#{commentTime},</if>
  48. </trim>
  49. </insert>
  50. <update id="updateCmcContractComment" parameterType="CmcContractComment">
  51. update cmc_contract_comment
  52. <trim prefix="SET" suffixOverrides=",">
  53. <if test="contractId != null">contract_id = #{contractId},</if>
  54. <if test="deptId != null">dept_id = #{deptId},</if>
  55. <if test="userId != null">user_id = #{userId},</if>
  56. <if test="comment != null">comment = #{comment},</if>
  57. <if test="commentTime != null">comment_time = #{commentTime},</if>
  58. </trim>
  59. where comment_id = #{commentId}
  60. </update>
  61. <delete id="deleteCmcContractCommentByCommentId" parameterType="String">
  62. delete from cmc_contract_comment where comment_id = #{commentId}
  63. </delete>
  64. <delete id="deleteCmcContractCommentByCommentIds" parameterType="String">
  65. delete from cmc_contract_comment where comment_id in
  66. <foreach item="commentId" collection="array" open="(" separator="," close=")">
  67. #{commentId}
  68. </foreach>
  69. </delete>
  70. </mapper>