| 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.FsHealthLifeMapper">
-
- <resultMap type="FsHealthLife" id="FsHealthLifeResult">
- <result property="id" column="id" />
- <result property="type" column="type" />
- <result property="userId" column="user_id" />
- <result property="formJson" column="form_json" />
- <result property="createTime" column="create_time" />
- </resultMap>
- <sql id="selectFsHealthLifeVo">
- select id, type, user_id, form_json, create_time from fs_health_life
- </sql>
- <select id="selectFsHealthLifeList" parameterType="FsHealthLife" resultMap="FsHealthLifeResult">
- <include refid="selectFsHealthLifeVo"/>
- <where>
- <if test="type != null "> and type = #{type}</if>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="formJson != null and formJson != ''"> and form_json = #{formJson}</if>
- </where>
- </select>
-
- <select id="selectFsHealthLifeById" parameterType="Long" resultMap="FsHealthLifeResult">
- <include refid="selectFsHealthLifeVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertFsHealthLife" parameterType="FsHealthLife" useGeneratedKeys="true" keyProperty="id">
- insert into fs_health_life
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="type != null">type,</if>
- <if test="userId != null">user_id,</if>
- <if test="formJson != null">form_json,</if>
- <if test="createTime != null">create_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="type != null">#{type},</if>
- <if test="userId != null">#{userId},</if>
- <if test="formJson != null">#{formJson},</if>
- <if test="createTime != null">#{createTime},</if>
- </trim>
- </insert>
- <update id="updateFsHealthLife" parameterType="FsHealthLife">
- update fs_health_life
- <trim prefix="SET" suffixOverrides=",">
- <if test="type != null">type = #{type},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="formJson != null">form_json = #{formJson},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFsHealthLifeById" parameterType="Long">
- delete from fs_health_life where id = #{id}
- </delete>
- <delete id="deleteFsHealthLifeByIds" parameterType="String">
- delete from fs_health_life where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|