FsProjectMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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.fs.his.mapper.FsProjectMapper">
  6. <resultMap type="FsProject" id="FsProjectResult">
  7. <result property="id" column="id" />
  8. <result property="projectName" column="project_name" />
  9. <result property="dayName" column="day_name" />
  10. <result property="createTime" column="create_time" />
  11. <result property="updateTime" column="update_time" />
  12. <result property="meridiansImgUrl" column="meridians_img_url" />
  13. <result property="firstField" column="first_field" />
  14. <result property="secondField" column="second_field" />
  15. <result property="thirdField" column="third_field" />
  16. <result property="fourthField" column="fourth_field" />
  17. <result property="firstContent" column="first_content" />
  18. <result property="secondContent" column="second_content" />
  19. <result property="thirdContent" column="third_content" />
  20. <result property="fourthContent" column="fourth_content" />
  21. </resultMap>
  22. <sql id="selectFsProjectVo">
  23. select id, project_name, day_name, create_time, update_time, meridians_img_url, first_field, second_field, third_field, fourth_field, first_content, second_content, third_content, fourth_content from fs_project
  24. </sql>
  25. <select id="selectFsProjectList" parameterType="FsProject" resultMap="FsProjectResult">
  26. <include refid="selectFsProjectVo"/>
  27. <where>
  28. <if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
  29. <if test="dayName != null and dayName != ''"> and day_name like concat('%', #{dayName}, '%')</if>
  30. <if test="meridiansImgUrl != null and meridiansImgUrl != ''"> and meridians_img_url = #{meridiansImgUrl}</if>
  31. <if test="firstField != null and firstField != ''"> and first_field = #{firstField}</if>
  32. <if test="secondField != null and secondField != ''"> and second_field = #{secondField}</if>
  33. <if test="thirdField != null and thirdField != ''"> and third_field = #{thirdField}</if>
  34. <if test="fourthField != null and fourthField != ''"> and fourth_field = #{fourthField}</if>
  35. <if test="firstContent != null and firstContent != ''"> and first_content = #{firstContent}</if>
  36. <if test="secondContent != null and secondContent != ''"> and second_content = #{secondContent}</if>
  37. <if test="thirdContent != null and thirdContent != ''"> and third_content = #{thirdContent}</if>
  38. <if test="fourthContent != null and fourthContent != ''"> and fourth_content = #{fourthContent}</if>
  39. </where>
  40. </select>
  41. <select id="selectFsProjectById" parameterType="Long" resultMap="FsProjectResult">
  42. <include refid="selectFsProjectVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertFsProject" parameterType="FsProject" useGeneratedKeys="true" keyProperty="id">
  46. insert into fs_project
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="projectName != null">project_name,</if>
  49. <if test="dayName != null">day_name,</if>
  50. <if test="createTime != null">create_time,</if>
  51. <if test="updateTime != null">update_time,</if>
  52. <if test="meridiansImgUrl != null">meridians_img_url,</if>
  53. <if test="firstField != null">first_field,</if>
  54. <if test="secondField != null">second_field,</if>
  55. <if test="thirdField != null">third_field,</if>
  56. <if test="fourthField != null">fourth_field,</if>
  57. <if test="firstContent != null">first_content,</if>
  58. <if test="secondContent != null">second_content,</if>
  59. <if test="thirdContent != null">third_content,</if>
  60. <if test="fourthContent != null">fourth_content,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="projectName != null">#{projectName},</if>
  64. <if test="dayName != null">#{dayName},</if>
  65. <if test="createTime != null">#{createTime},</if>
  66. <if test="updateTime != null">#{updateTime},</if>
  67. <if test="meridiansImgUrl != null">#{meridiansImgUrl},</if>
  68. <if test="firstField != null">#{firstField},</if>
  69. <if test="secondField != null">#{secondField},</if>
  70. <if test="thirdField != null">#{thirdField},</if>
  71. <if test="fourthField != null">#{fourthField},</if>
  72. <if test="firstContent != null">#{firstContent},</if>
  73. <if test="secondContent != null">#{secondContent},</if>
  74. <if test="thirdContent != null">#{thirdContent},</if>
  75. <if test="fourthContent != null">#{fourthContent},</if>
  76. </trim>
  77. </insert>
  78. <update id="updateFsProject" parameterType="FsProject">
  79. update fs_project
  80. <trim prefix="SET" suffixOverrides=",">
  81. <if test="projectName != null">project_name = #{projectName},</if>
  82. <if test="dayName != null">day_name = #{dayName},</if>
  83. <if test="createTime != null">create_time = #{createTime},</if>
  84. <if test="updateTime != null">update_time = #{updateTime},</if>
  85. <if test="meridiansImgUrl != null">meridians_img_url = #{meridiansImgUrl},</if>
  86. <if test="firstField != null">first_field = #{firstField},</if>
  87. <if test="secondField != null">second_field = #{secondField},</if>
  88. <if test="thirdField != null">third_field = #{thirdField},</if>
  89. <if test="fourthField != null">fourth_field = #{fourthField},</if>
  90. <if test="firstContent != null">first_content = #{firstContent},</if>
  91. <if test="secondContent != null">second_content = #{secondContent},</if>
  92. <if test="thirdContent != null">third_content = #{thirdContent},</if>
  93. <if test="fourthContent != null">fourth_content = #{fourthContent},</if>
  94. </trim>
  95. where id = #{id}
  96. </update>
  97. <delete id="deleteFsProjectById" parameterType="Long">
  98. delete from fs_project where id = #{id}
  99. </delete>
  100. <delete id="deleteFsProjectByIds" parameterType="String">
  101. delete from fs_project where id in
  102. <foreach item="id" collection="array" open="(" separator="," close=")">
  103. #{id}
  104. </foreach>
  105. </delete>
  106. </mapper>