ThoughtPlanFuMapper.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.ThoughtPlanFuMapper">
  6. <resultMap type="ThoughtPlanFu" id="ThoughtPlanFuResult">
  7. <result property="id" column="id" />
  8. <result property="planId" column="plan_id" />
  9. <result property="planContent" column="plan_content" />
  10. <result property="isresponse" column="isresponse" />
  11. </resultMap>
  12. <sql id="selectThoughtPlanFuVo">
  13. select id, plan_id, plan_content, isresponse from thought_plan_fu
  14. </sql>
  15. <select id="selectThoughtPlanFuList" parameterType="ThoughtPlanFu" resultMap="ThoughtPlanFuResult">
  16. <include refid="selectThoughtPlanFuVo"/>
  17. <where>
  18. <if test="planId != null "> and plan_id = #{planId}</if>
  19. <if test="planContent != null and planContent != ''"> and plan_content = #{planContent}</if>
  20. <if test="isresponse != null and isresponse != ''"> and isresponse = #{isresponse}</if>
  21. </where>
  22. </select>
  23. <select id="selectThoughtPlanFuById" parameterType="Long" resultMap="ThoughtPlanFuResult">
  24. <include refid="selectThoughtPlanFuVo"/>
  25. where id = #{id}
  26. </select>
  27. <insert id="insertThoughtPlanFu" parameterType="ThoughtPlanFu" useGeneratedKeys="true" keyProperty="id">
  28. insert into thought_plan_fu
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="planId != null">plan_id,</if>
  31. <if test="planContent != null">plan_content,</if>
  32. <if test="isresponse != null">isresponse,</if>
  33. </trim>
  34. <trim prefix="values (" suffix=")" suffixOverrides=",">
  35. <if test="planId != null">#{planId},</if>
  36. <if test="planContent != null">#{planContent},</if>
  37. <if test="isresponse != null">#{isresponse},</if>
  38. </trim>
  39. </insert>
  40. <update id="updateThoughtPlanFu" parameterType="ThoughtPlanFu">
  41. update thought_plan_fu
  42. <trim prefix="SET" suffixOverrides=",">
  43. <if test="planId != null">plan_id = #{planId},</if>
  44. <if test="planContent != null">plan_content = #{planContent},</if>
  45. <if test="isresponse != null">isresponse = #{isresponse},</if>
  46. </trim>
  47. where id = #{id}
  48. </update>
  49. <delete id="deleteThoughtPlanFuById" parameterType="Long">
  50. delete from thought_plan_fu where id = #{id}
  51. </delete>
  52. <delete id="deleteThoughtPlanFuByIds" parameterType="String">
  53. delete from thought_plan_fu where id in
  54. <foreach item="id" collection="array" open="(" separator="," close=")">
  55. #{id}
  56. </foreach>
  57. </delete>
  58. <delete id="deleteThoughtPlanFuBy">
  59. delete from thought_plan_fu where plan_id = #{planId}
  60. </delete>
  61. </mapper>