| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?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.FsHealthSurfaceMapper">
- <resultMap type="FsHealthSurface" id="FsHealthSurfaceResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="name" column="name" />
- <result property="sex" column="sex" />
- <result property="age" column="age" />
- <result property="status" column="status" />
- <result property="surfaceUrl" column="surface_url" />
- <result property="complexionResult" column="complexion_result" />
- <result property="complexionTypes" column="complexion_types" />
- <result property="spotProblems" column="spot_problems" />
- <result property="swellingProblems" column="swelling_problems" />
- <result property="glowResult" column="glow_result" />
- <result property="diagnosisSummary" column="diagnosis_summary" />
- <result property="healthSuggestions" column="health_suggestions" />
- <result property="createTime" column="create_time" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectFsHealthSurfaceVo">
- select id, user_id, name, sex, age, status, surface_url, complexion_result, complexion_types, spot_problems, swelling_problems, glow_result, diagnosis_summary, health_suggestions,create_time,remark from fs_health_surface
- </sql>
- <select id="selectFsHealthSurfaceList" parameterType="FsHealthSurface" resultMap="FsHealthSurfaceResult">
- <include refid="selectFsHealthSurfaceVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="sex != null "> and sex = #{sex}</if>
- <if test="age != null "> and age = #{age}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="surfaceUrl != null and surfaceUrl != ''"> and surface_url = #{surfaceUrl}</if>
- <if test="complexionResult != null and complexionResult != ''"> and complexion_result = #{complexionResult}</if>
- <if test="complexionTypes != null and complexionTypes != ''"> and complexion_types = #{complexionTypes}</if>
- <if test="spotProblems != null and spotProblems != ''"> and spot_problems = #{spotProblems}</if>
- <if test="swellingProblems != null and swellingProblems != ''"> and swelling_problems = #{swellingProblems}</if>
- <if test="glowResult != null and glowResult != ''"> and glow_result = #{glowResult}</if>
- <if test="diagnosisSummary != null and diagnosisSummary != ''"> and diagnosis_summary = #{diagnosisSummary}</if>
- <if test="healthSuggestions != null and healthSuggestions != ''"> and health_suggestions = #{healthSuggestions}</if>
- <if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
- <if test="remark != null and remark != ''"> and remark = #{remark}</if>
- </where>
- </select>
- <select id="selectFsHealthSurfaceById" parameterType="Long" resultMap="FsHealthSurfaceResult">
- <include refid="selectFsHealthSurfaceVo"/>
- where id = #{id}
- </select>
- <select id="selectFsHealthSurfaceListVO" resultType="com.fs.his.vo.FsHealthSurfaceListVO">
- select * from fs_health_surface where user_id=#{userId}
- <if test="createDay != null and createDay !=''">
- AND DATE(create_time) = #{createDay}
- </if>
- order by create_time desc
- </select>
- <select id="selectListByDateAndUserId" resultType="java.lang.String">
- select DATE(create_time) from fs_health_surface
- <where>
- <if test="startDate != null">
- and create_time <![CDATA[>=]]> #{startDate}
- </if>
- <if test="endDate != null">
- and create_time <![CDATA[<=]]> #{endDate}
- </if>
- <if test="userId != null">
- and user_id= #{userId}
- </if>
- </where>
- GROUP BY DATE(create_time)
- </select>
- <insert id="insertFsHealthSurface" parameterType="FsHealthSurface" useGeneratedKeys="true" keyProperty="id">
- insert into fs_health_surface
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="name != null">name,</if>
- <if test="sex != null">sex,</if>
- <if test="age != null">age,</if>
- <if test="status != null">status,</if>
- <if test="surfaceUrl != null">surface_url,</if>
- <if test="complexionResult != null">complexion_result,</if>
- <if test="complexionTypes != null">complexion_types,</if>
- <if test="spotProblems != null">spot_problems,</if>
- <if test="swellingProblems != null">swelling_problems,</if>
- <if test="glowResult != null">glow_result,</if>
- <if test="diagnosisSummary != null">diagnosis_summary,</if>
- <if test="healthSuggestions != null">health_suggestions,</if>
- <if test="createTime != null">create_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="name != null">#{name},</if>
- <if test="sex != null">#{sex},</if>
- <if test="age != null">#{age},</if>
- <if test="status != null">#{status},</if>
- <if test="surfaceUrl != null">#{surfaceUrl},</if>
- <if test="complexionResult != null">#{complexionResult},</if>
- <if test="complexionTypes != null">#{complexionTypes},</if>
- <if test="spotProblems != null">#{spotProblems},</if>
- <if test="swellingProblems != null">#{swellingProblems},</if>
- <if test="glowResult != null">#{glowResult},</if>
- <if test="diagnosisSummary != null">#{diagnosisSummary},</if>
- <if test="healthSuggestions != null">#{healthSuggestions},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateFsHealthSurface" parameterType="FsHealthSurface">
- update fs_health_surface
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="name != null">name = #{name},</if>
- <if test="sex != null">sex = #{sex},</if>
- <if test="age != null">age = #{age},</if>
- <if test="status != null">status = #{status},</if>
- <if test="surfaceUrl != null">surface_url = #{surfaceUrl},</if>
- <if test="complexionResult != null">complexion_result = #{complexionResult},</if>
- <if test="complexionTypes != null">complexion_types = #{complexionTypes},</if>
- <if test="spotProblems != null">spot_problems = #{spotProblems},</if>
- <if test="swellingProblems != null">swelling_problems = #{swellingProblems},</if>
- <if test="glowResult != null">glow_result = #{glowResult},</if>
- <if test="diagnosisSummary != null">diagnosis_summary = #{diagnosisSummary},</if>
- <if test="healthSuggestions != null">health_suggestions = #{healthSuggestions},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFsHealthSurfaceById" parameterType="Long">
- delete from fs_health_surface where id = #{id}
- </delete>
- <delete id="deleteFsHealthSurfaceByIds" parameterType="String">
- delete from fs_health_surface where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|