| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fs.his.mapper.FsQuestionAndAnswerMapper">
- <resultMap type="FsQuestionAndAnswer" id="FsQuestionAndAnswerResult">
- <result property="id" column="id" />
- <result property="jsonInfo" column="json_info" />
- <result property="questionName" column="question_name" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectFsQuestionAndAnswerVo">
- select id,question_name ,json_info, create_time, update_time from fs_question_and_answer
- </sql>
- <select id="selectFsQuestionAndAnswerList" parameterType="FsQuestionAndAnswer" resultMap="FsQuestionAndAnswerResult">
- <include refid="selectFsQuestionAndAnswerVo"/>
- <where>
- <if test="jsonInfo != null and jsonInfo != ''"> and json_info = #{jsonInfo}</if>
- </where>
- </select>
- <select id="selectFsQuestionAndAnswerById" parameterType="Long" resultMap="FsQuestionAndAnswerResult">
- <include refid="selectFsQuestionAndAnswerVo"/>
- where id = #{id}
- </select>
- <insert id="insertFsQuestionAndAnswer" parameterType="FsQuestionAndAnswer">
- insert into fs_question_and_answer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="jsonInfo != null">json_info,</if>
- <if test="questionName != null">question_name,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="jsonInfo != null">#{jsonInfo},</if>
- <if test="questionName != null">#{questionName},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateFsQuestionAndAnswer" parameterType="FsQuestionAndAnswer">
- update fs_question_and_answer
- <trim prefix="SET" suffixOverrides=",">
- <if test="jsonInfo != null">json_info = #{jsonInfo},</if>
- <if test="questionName != null">question_name = #{questionName},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFsQuestionAndAnswerById" parameterType="Long">
- delete from fs_question_and_answer where id = #{id}
- </delete>
- <delete id="deleteFsQuestionAndAnswerByIds" parameterType="String">
- delete from fs_question_and_answer where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|