| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?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.FsUserWatchMapper">
- <resultMap type="FsUserWatch" id="FsUserWatchResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="companyId" column="company_id" />
- <result property="companyUserId" column="company_user_id" />
- <result property="doctorId" column="doctor_id" />
- <result property="storeOrderId" column="store_order_id" />
- <result property="status" column="status" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectFsUserWatchVo">
- select id, user_id, company_id, company_user_id, doctor_id, store_order_id, status, create_time, update_time from fs_user_watch
- </sql>
- <select id="selectFsUserWatchList" parameterType="FsUserWatch" resultMap="FsUserWatchResult">
- <include refid="selectFsUserWatchVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
- <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
- <if test="storeOrderId != null "> and store_order_id = #{storeOrderId}</if>
- <if test="status != null "> and status = #{status}</if>
- </where>
- order by create_time desc
- </select>
- <select id="selectFsUserWatchById" parameterType="Long" resultMap="FsUserWatchResult">
- <include refid="selectFsUserWatchVo"/>
- where id = #{id}
- </select>
- <select id="getLastByUserId" resultType="com.fs.his.domain.FsUserWatch">
- <include refid="selectFsUserWatchVo"></include>
- where user_id = #{userId}
- order by create_time limit 1
- </select>
- <insert id="insertFsUserWatch" parameterType="FsUserWatch">
- insert into fs_user_watch
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="userId != null">user_id,</if>
- <if test="companyId != null">company_id,</if>
- <if test="companyUserId != null">company_user_id,</if>
- <if test="doctorId != null">doctor_id,</if>
- <if test="storeOrderId != null">store_order_id,</if>
- <if test="status != null">status,</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="userId != null">#{userId},</if>
- <if test="companyId != null">#{companyId},</if>
- <if test="companyUserId != null">#{companyUserId},</if>
- <if test="doctorId != null">#{doctorId},</if>
- <if test="storeOrderId != null">#{storeOrderId},</if>
- <if test="status != null">#{status},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateFsUserWatch" parameterType="FsUserWatch">
- update fs_user_watch
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="companyId != null">company_id = #{companyId},</if>
- <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
- <if test="doctorId != null">doctor_id = #{doctorId},</if>
- <if test="storeOrderId != null">store_order_id = #{storeOrderId},</if>
- <if test="status != null">status = #{status},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFsUserWatchById" parameterType="Long">
- delete from fs_user_watch where id = #{id}
- </delete>
- <delete id="deleteFsUserWatchByIds" parameterType="String">
- delete from fs_user_watch where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|