ThoughtResponseContentMapper.xml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.supervision.thought.mapper.ThoughtResponseContentMapper">
  6. <resultMap type="ThoughtResponseContent" id="ThoughtResponseContentResult">
  7. <result property="id" column="id" />
  8. <result property="planId" column="plan_id" />
  9. <result property="planContent" column="plan_content" />
  10. <result property="responseStatus" column="response_status" />
  11. <result property="isresponse" column="isresponse" />
  12. </resultMap>
  13. <sql id="selectThoughtResponseContentVo">
  14. select id, plan_id, plan_content, response_status,isresponse from thought_response_content
  15. </sql>
  16. <select id="selectThoughtResponseContentList" parameterType="ThoughtResponseContent" resultMap="ThoughtResponseContentResult">
  17. <include refid="selectThoughtResponseContentVo"/>
  18. <where>
  19. <if test="planId != null "> and plan_id = #{planId}</if>
  20. <if test="planContent != null and planContent != ''"> and plan_content = #{planContent}</if>
  21. <if test="responseStatus != null and responseStatus != ''"> and response_status = #{responseStatus}</if>
  22. <if test="isresponse != null and isresponse != ''"> and isresponse = #{isresponse}</if>
  23. </where>
  24. </select>
  25. <select id="selectThoughtResponseContentById" parameterType="Long" resultMap="ThoughtResponseContentResult">
  26. <include refid="selectThoughtResponseContentVo"/>
  27. where id = #{id}
  28. </select>
  29. <insert id="insertThoughtResponseContent" parameterType="ThoughtResponseContent" useGeneratedKeys="true" keyProperty="id">
  30. insert into thought_response_content
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="planId != null">plan_id,</if>
  33. <if test="planContent != null">plan_content,</if>
  34. <if test="responseStatus != null">response_status,</if>
  35. <if test="isresponse != null">isresponse,</if>
  36. </trim>
  37. <trim prefix="values (" suffix=")" suffixOverrides=",">
  38. <if test="planId != null">#{planId},</if>
  39. <if test="planContent != null">#{planContent},</if>
  40. <if test="responseStatus != null">#{responseStatus},</if>
  41. <if test="isresponse != null">#{isresponse},</if>
  42. </trim>
  43. </insert>
  44. <update id="updateThoughtResponseContent" parameterType="ThoughtResponseContent">
  45. update thought_response_content
  46. <trim prefix="SET" suffixOverrides=",">
  47. <if test="planId != null">plan_id = #{planId},</if>
  48. <if test="planContent != null">plan_content = #{planContent},</if>
  49. <if test="responseStatus != null">response_status = #{responseStatus},</if>
  50. <if test="isresponse != null">isresponse = #{isresponse},</if>
  51. </trim>
  52. where id = #{id}
  53. </update>
  54. <delete id="deleteThoughtResponseContentById" parameterType="Long">
  55. delete from thought_response_content where id = #{id}
  56. </delete>
  57. <delete id="deleteThoughtResponseContentByIds" parameterType="String">
  58. delete from thought_response_content where id in
  59. <foreach item="id" collection="array" open="(" separator="," close=")">
  60. #{id}
  61. </foreach>
  62. </delete>
  63. </mapper>