FsQuestionAndAnswerMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.FsQuestionAndAnswerMapper">
  6. <resultMap type="FsQuestionAndAnswer" id="FsQuestionAndAnswerResult">
  7. <result property="id" column="id" />
  8. <result property="jsonInfo" column="json_info" />
  9. <result property="questionName" column="question_name" />
  10. <result property="createTime" column="create_time" />
  11. <result property="updateTime" column="update_time" />
  12. </resultMap>
  13. <sql id="selectFsQuestionAndAnswerVo">
  14. select id,question_name ,json_info, create_time, update_time from fs_question_and_answer
  15. </sql>
  16. <select id="selectFsQuestionAndAnswerList" parameterType="FsQuestionAndAnswer" resultMap="FsQuestionAndAnswerResult">
  17. <include refid="selectFsQuestionAndAnswerVo"/>
  18. <where>
  19. <if test="jsonInfo != null and jsonInfo != ''"> and json_info = #{jsonInfo}</if>
  20. </where>
  21. </select>
  22. <select id="selectFsQuestionAndAnswerById" parameterType="Long" resultMap="FsQuestionAndAnswerResult">
  23. <include refid="selectFsQuestionAndAnswerVo"/>
  24. where id = #{id}
  25. </select>
  26. <insert id="insertFsQuestionAndAnswer" parameterType="FsQuestionAndAnswer">
  27. insert into fs_question_and_answer
  28. <trim prefix="(" suffix=")" suffixOverrides=",">
  29. <if test="id != null">id,</if>
  30. <if test="jsonInfo != null">json_info,</if>
  31. <if test="questionName != null">question_name,</if>
  32. <if test="createTime != null">create_time,</if>
  33. <if test="updateTime != null">update_time,</if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides=",">
  36. <if test="id != null">#{id},</if>
  37. <if test="jsonInfo != null">#{jsonInfo},</if>
  38. <if test="questionName != null">#{questionName},</if>
  39. <if test="createTime != null">#{createTime},</if>
  40. <if test="updateTime != null">#{updateTime},</if>
  41. </trim>
  42. </insert>
  43. <update id="updateFsQuestionAndAnswer" parameterType="FsQuestionAndAnswer">
  44. update fs_question_and_answer
  45. <trim prefix="SET" suffixOverrides=",">
  46. <if test="jsonInfo != null">json_info = #{jsonInfo},</if>
  47. <if test="questionName != null">question_name = #{questionName},</if>
  48. <if test="createTime != null">create_time = #{createTime},</if>
  49. <if test="updateTime != null">update_time = #{updateTime},</if>
  50. </trim>
  51. where id = #{id}
  52. </update>
  53. <delete id="deleteFsQuestionAndAnswerById" parameterType="Long">
  54. delete from fs_question_and_answer where id = #{id}
  55. </delete>
  56. <delete id="deleteFsQuestionAndAnswerByIds" parameterType="String">
  57. delete from fs_question_and_answer where id in
  58. <foreach item="id" collection="array" open="(" separator="," close=")">
  59. #{id}
  60. </foreach>
  61. </delete>
  62. </mapper>