<?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.TjContractMapper">
|
|
<resultMap type="TjContract" id="TjContractResult">
|
<result property="id" column="id"/>
|
<result property="drugManufacturerId" column="drug_manufacturer_id"/>
|
<result property="contractName" column="contract_name"/>
|
<result property="signTime" column="sign_time"/>
|
<result property="aSignPerson" column="a_sign_person"/>
|
<result property="aSignPhone" column="a_sign_phone"/>
|
<result property="bSignPerson" column="b_sign_person"/>
|
<result property="bSignPhone" column="b_sign_phone"/>
|
<result property="contractAmount" column="contract_amount"/>
|
<result property="contractValidTime" column="contract_valid_time"/>
|
<result property="contractStatus" column="contract_status"/>
|
<result property="remark" column="remark"/>
|
<result property="deleted" column="deleted"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
|
<sql id="selectTjContractVo">
|
select id, drug_manufacturer_id, contract_name, sign_time, a_sign_person, a_sign_phone, b_sign_person, b_sign_phone, contract_amount, contract_valid_time, contract_status, remark, deleted, create_by, create_time, update_by, update_time
|
from tj_contract
|
</sql>
|
|
<select id="selectTjContractList" parameterType="TjContract" resultMap="TjContractResult">
|
<include refid="selectTjContractVo"/>
|
<where>
|
<if test="drugManufacturerId != null ">
|
and drug_manufacturer_id = #{drugManufacturerId}
|
</if>
|
<if test="contractName != null and contractName != ''">
|
and contract_name like concat('%', #{contractName}, '%')
|
</if>
|
<if test="aSignPerson != null and aSignPerson != ''">
|
and a_sign_person = #{aSignPerson}
|
</if>
|
<if test="bSignPerson != null and bSignPerson != ''">
|
and b_sign_person = #{bSignPerson}
|
</if>
|
<if test="contractStatus != null and contractStatus != ''">
|
and contract_status = #{contractStatus}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectTjContractById" parameterType="Long"
|
resultMap="TjContractResult">
|
<include refid="selectTjContractVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTjContract" parameterType="TjContract">
|
insert into tj_contract
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,
|
</if>
|
<if test="drugManufacturerId != null">drug_manufacturer_id,
|
</if>
|
<if test="contractName != null">contract_name,
|
</if>
|
<if test="signTime != null">sign_time,
|
</if>
|
<if test="aSignPerson != null">a_sign_person,
|
</if>
|
<if test="aSignPhone != null">a_sign_phone,
|
</if>
|
<if test="bSignPerson != null">b_sign_person,
|
</if>
|
<if test="bSignPhone != null">b_sign_phone,
|
</if>
|
<if test="contractAmount != null">contract_amount,
|
</if>
|
<if test="contractValidTime != null">contract_valid_time,
|
</if>
|
<if test="contractStatus != null">contract_status,
|
</if>
|
<if test="remark != null">remark,
|
</if>
|
<if test="deleted != null">deleted,
|
</if>
|
<if test="createBy != null">create_by,
|
</if>
|
<if test="createTime != null">create_time,
|
</if>
|
<if test="updateBy != null">update_by,
|
</if>
|
<if test="updateTime != null">update_time,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},
|
</if>
|
<if test="drugManufacturerId != null">#{drugManufacturerId},
|
</if>
|
<if test="contractName != null">#{contractName},
|
</if>
|
<if test="signTime != null">#{signTime},
|
</if>
|
<if test="aSignPerson != null">#{aSignPerson},
|
</if>
|
<if test="aSignPhone != null">#{aSignPhone},
|
</if>
|
<if test="bSignPerson != null">#{bSignPerson},
|
</if>
|
<if test="bSignPhone != null">#{bSignPhone},
|
</if>
|
<if test="contractAmount != null">#{contractAmount},
|
</if>
|
<if test="contractValidTime != null">#{contractValidTime},
|
</if>
|
<if test="contractStatus != null">#{contractStatus},
|
</if>
|
<if test="remark != null">#{remark},
|
</if>
|
<if test="deleted != null">#{deleted},
|
</if>
|
<if test="createBy != null">#{createBy},
|
</if>
|
<if test="createTime != null">#{createTime},
|
</if>
|
<if test="updateBy != null">#{updateBy},
|
</if>
|
<if test="updateTime != null">#{updateTime},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateTjContract" parameterType="TjContract">
|
update tj_contract
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="drugManufacturerId != null">drug_manufacturer_id =
|
#{drugManufacturerId},
|
</if>
|
<if test="contractName != null">contract_name =
|
#{contractName},
|
</if>
|
<if test="signTime != null">sign_time =
|
#{signTime},
|
</if>
|
<if test="aSignPerson != null">a_sign_person =
|
#{aSignPerson},
|
</if>
|
<if test="aSignPhone != null">a_sign_phone =
|
#{aSignPhone},
|
</if>
|
<if test="bSignPerson != null">b_sign_person =
|
#{bSignPerson},
|
</if>
|
<if test="bSignPhone != null">b_sign_phone =
|
#{bSignPhone},
|
</if>
|
<if test="contractAmount != null">contract_amount =
|
#{contractAmount},
|
</if>
|
<if test="contractValidTime != null">contract_valid_time =
|
#{contractValidTime},
|
</if>
|
<if test="contractStatus != null">contract_status =
|
#{contractStatus},
|
</if>
|
<if test="remark != null">remark =
|
#{remark},
|
</if>
|
<if test="deleted != null">deleted =
|
#{deleted},
|
</if>
|
<if test="createBy != null">create_by =
|
#{createBy},
|
</if>
|
<if test="createTime != null">create_time =
|
#{createTime},
|
</if>
|
<if test="updateBy != null">update_by =
|
#{updateBy},
|
</if>
|
<if test="updateTime != null">update_time =
|
#{updateTime},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTjContractById" parameterType="Long">
|
delete
|
from tj_contract where id = #{id}
|
</delete>
|
|
<delete id="deleteTjContractByIds" parameterType="String">
|
delete from tj_contract where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|