ThoughtPlanFujianMapper.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.ThoughtPlanFujianMapper">
  6. <resultMap type="ThoughtPlanFujian" id="ThoughtPlanFujianResult">
  7. <result property="id" column="id" />
  8. <result property="planId" column="plan_id" />
  9. <result property="fileName" column="file_name" />
  10. <result property="filePath" column="file_path" />
  11. </resultMap>
  12. <sql id="selectThoughtPlanFujianVo">
  13. select id, plan_id, file_name, file_path from thought_plan_fujian
  14. </sql>
  15. <select id="selectThoughtPlanFujianList" parameterType="ThoughtPlanFujian" resultMap="ThoughtPlanFujianResult">
  16. <include refid="selectThoughtPlanFujianVo"/>
  17. <where>
  18. <if test="planId != null "> and plan_id = #{planId}</if>
  19. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  20. <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
  21. </where>
  22. </select>
  23. <select id="selectThoughtPlanFujianById" parameterType="Long" resultMap="ThoughtPlanFujianResult">
  24. <include refid="selectThoughtPlanFujianVo"/>
  25. where id = #{id}
  26. </select>
  27. <insert id="insertThoughtPlanFujian" parameterType="ThoughtPlanFujian" useGeneratedKeys="true" keyProperty="id">
  28. insert into thought_plan_fujian
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="planId != null">plan_id,</if>
  31. <if test="fileName != null">file_name,</if>
  32. <if test="filePath != null">file_path,</if>
  33. </trim>
  34. <trim prefix="values (" suffix=")" suffixOverrides=",">
  35. <if test="planId != null">#{planId},</if>
  36. <if test="fileName != null">#{fileName},</if>
  37. <if test="filePath != null">#{filePath},</if>
  38. </trim>
  39. </insert>
  40. <update id="updateThoughtPlanFujian" parameterType="ThoughtPlanFujian">
  41. update thought_plan_fujian
  42. <trim prefix="SET" suffixOverrides=",">
  43. <if test="planId != null">plan_id = #{planId},</if>
  44. <if test="fileName != null">file_name = #{fileName},</if>
  45. <if test="filePath != null">file_path = #{filePath},</if>
  46. </trim>
  47. where id = #{id}
  48. </update>
  49. <delete id="deleteThoughtPlanFujianById" parameterType="Long">
  50. delete from thought_plan_fujian where id = #{id}
  51. </delete>
  52. <delete id="deleteThoughtPlanFujianByIds" parameterType="String">
  53. delete from thought_plan_fujian where id in
  54. <foreach item="id" collection="array" open="(" separator="," close=")">
  55. #{id}
  56. </foreach>
  57. </delete>
  58. <delete id="deleteThoughtPlanFujian">
  59. delete from thought_plan_fujian where plan_id = #{planId}
  60. </delete>
  61. </mapper>