| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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.hospital.mapper.HospitalMemberLevelMapper">
- <resultMap type="HospitalMemberLevel" id="HospitalMemberLevelResult">
- <result property="levelId" column="level_id" />
- <result property="levelName" column="level_name" />
- <result property="level" column="level" />
- <result property="levelValue" column="level_value" />
- <result property="totalIntegral" column="total_integral" />
- <result property="hospitalId" column="hospital_id" />
- <result property="configJson" column="config_json" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- </resultMap>
- <sql id="selectHospitalMemberLevelVo">
- select level_id, level_name, level, level_value,total_integral, hospital_id, config_json, create_time, update_time, create_by, update_by from hospital_member_level
- </sql>
- <select id="selectHospitalMemberLevelList" parameterType="HospitalMemberLevel" resultMap="HospitalMemberLevelResult">
- <include refid="selectHospitalMemberLevelVo"/>
- <where>
- <if test="levelName != null and levelName != ''"> and level_name like concat('%', #{levelName}, '%')</if>
- <if test="level != null "> and level = #{level}</if>
- <if test="levelValue != null "> and level_value = #{levelValue}</if>
- <if test="totalIntegral != null "> and total_integral = #{totalIntegral}</if>
- <if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
- <if test="configJson != null and configJson != ''"> and config_json = #{configJson}</if>
- </where>
- </select>
- <select id="selectHospitalMemberLevelByLevelId" parameterType="Long" resultMap="HospitalMemberLevelResult">
- <include refid="selectHospitalMemberLevelVo"/>
- where level_id = #{levelId}
- </select>
- <insert id="insertHospitalMemberLevel" parameterType="HospitalMemberLevel" useGeneratedKeys="true" keyProperty="levelId">
- insert into hospital_member_level
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="levelName != null">level_name,</if>
- <if test="level != null">level,</if>
- <if test="levelValue != null">level_value,</if>
- <if test="totalIntegral != null">total_integral,</if>
- <if test="hospitalId != null">hospital_id,</if>
- <if test="configJson != null">config_json,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="levelName != null">#{levelName},</if>
- <if test="level != null">#{level},</if>
- <if test="levelValue != null">#{levelValue},</if>
- <if test="totalIntegral != null">#{totalIntegral},</if>
- <if test="hospitalId != null">#{hospitalId},</if>
- <if test="configJson != null">#{configJson},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- </trim>
- </insert>
- <update id="updateHospitalMemberLevel" parameterType="HospitalMemberLevel">
- update hospital_member_level
- <trim prefix="SET" suffixOverrides=",">
- <if test="levelName != null">level_name = #{levelName},</if>
- <if test="level != null">level = #{level},</if>
- <if test="levelValue != null">level_value = #{levelValue},</if>
- <if test="totalIntegral != null">total_integral = #{totalIntegral},</if>
- <if test="hospitalId != null">hospital_id = #{hospitalId},</if>
- <if test="configJson != null">config_json = #{configJson},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- </trim>
- where level_id = #{levelId}
- </update>
- <delete id="deleteHospitalMemberLevelByLevelId" parameterType="Long">
- delete from hospital_member_level where level_id = #{levelId}
- </delete>
- <delete id="deleteHospitalMemberLevelByLevelIds" parameterType="String">
- delete from hospital_member_level where level_id in
- <foreach item="levelId" collection="array" open="(" separator="," close=")">
- #{levelId}
- </foreach>
- </delete>
- </mapper>
|