<?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.ltkj.hosp.mapper.TbTransitionMapper">
|
|
<resultMap type="TbTransition" id="TbTransitionResult">
|
<result property="id" column="id"/>
|
<result property="cusId" column="cus_id"/>
|
<result property="pacId" column="pac_id"/>
|
<result property="pacName" column="pac_name"/>
|
<result property="proId" column="pro_id"/>
|
<result property="proName" column="pro_name"/>
|
<result property="parentProId" column="parent_pro_id"/>
|
<result property="parentProName" column="parent_pro_name"/>
|
<result property="ordPrice" column="ord_price"/>
|
<result property="nowPrice" column="now_price"/>
|
</resultMap>
|
|
<sql id="selectTbTransitionVo">
|
select id,
|
cus_id,
|
pac_id,
|
pac_name,
|
pro_id,
|
pro_name,
|
parent_pro_id,
|
parent_pro_name,
|
ord_price,
|
now_price
|
from tb_transition
|
</sql>
|
|
<select id="selectTbTransitionList" parameterType="TbTransition" resultMap="TbTransitionResult">
|
<include refid="selectTbTransitionVo"/>
|
<where>
|
<if test="cusId != null ">and cus_id = #{cusId}</if>
|
<if test="pacId != null ">and pac_id = #{pacId}</if>
|
<if test="pacName != null and pacName != ''">and pac_name like concat('%', #{pacName}, '%')</if>
|
<if test="proId != null ">and pro_id = #{proId}</if>
|
<if test="proName != null and proName != ''">and pro_name like concat('%', #{proName}, '%')</if>
|
<if test="parentProId != null ">and parent_pro_id = #{parentProId}</if>
|
<if test="parentProName != null and parentProName != ''">and parent_pro_name like concat('%',
|
#{parentProName}, '%')
|
</if>
|
<if test="ordPrice != null ">and ord_price = #{ordPrice}</if>
|
<if test="nowPrice != null ">and now_price = #{nowPrice}</if>
|
</where>
|
</select>
|
|
<select id="selectTbTransitionById" parameterType="String" resultMap="TbTransitionResult">
|
<include refid="selectTbTransitionVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTbTransition" parameterType="TbTransition">
|
insert into tb_transition
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="cusId != null">cus_id,</if>
|
<if test="pacId != null">pac_id,</if>
|
<if test="pacName != null">pac_name,</if>
|
<if test="proId != null">pro_id,</if>
|
<if test="proName != null">pro_name,</if>
|
<if test="parentProId != null">parent_pro_id,</if>
|
<if test="parentProName != null">parent_pro_name,</if>
|
<if test="ordPrice != null">ord_price,</if>
|
<if test="nowPrice != null">now_price,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="cusId != null">#{cusId},</if>
|
<if test="pacId != null">#{pacId},</if>
|
<if test="pacName != null">#{pacName},</if>
|
<if test="proId != null">#{proId},</if>
|
<if test="proName != null">#{proName},</if>
|
<if test="parentProId != null">#{parentProId},</if>
|
<if test="parentProName != null">#{parentProName},</if>
|
<if test="ordPrice != null">#{ordPrice},</if>
|
<if test="nowPrice != null">#{nowPrice},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTbTransition" parameterType="TbTransition">
|
update tb_transition
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="cusId != null">cus_id = #{cusId},</if>
|
<if test="pacId != null">pac_id = #{pacId},</if>
|
<if test="pacName != null">pac_name = #{pacName},</if>
|
<if test="proId != null">pro_id = #{proId},</if>
|
<if test="proName != null">pro_name = #{proName},</if>
|
<if test="parentProId != null">parent_pro_id = #{parentProId},</if>
|
<if test="parentProName != null">parent_pro_name = #{parentProName},</if>
|
<if test="ordPrice != null">ord_price = #{ordPrice},</if>
|
<if test="nowPrice != null">now_price = #{nowPrice},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTbTransitionById" parameterType="String">
|
delete
|
from tb_transition
|
where id = #{id}
|
</delete>
|
|
<delete id="deleteTbTransitionByIds" parameterType="String">
|
delete from tb_transition where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|