liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml
@@ -3,8 +3,8 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.PatMedPhysicalMapper">
    <resultMap type="PatMedPhysical" id="PatMedPhysicalResult">
    <resultMap type="com.smartor.domain.PatMedPhysical" id="PatMedPhysicalResult">
        <result property="id"    column="id"    />
        <result property="serialnum"    column="serialnum"    />
        <result property="patid"    column="patid"    />
@@ -31,28 +31,32 @@
        <result property="deptid"    column="deptid"    />
        <result property="projectid"    column="projectid"    />
        <result property="schemetime"    column="schemetime"    />
        <result property="patname"    column="patname"    />
        <result property="patno"    column="patno"    />
    </resultMap>
    <sql id="selectPatMedPhysicalVo">
        select id, serialnum, patid, drcode, drname, hospitalcode, hospitalname, physicaldate, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, deptcode, deptname, projectname, projectcode, state, schemestatus, generalschemestatus, deptid, projectid, schemetime from pat_med_physical
        select id, serialnum, patid, patname, patno, drcode, drname, hospitalcode, hospitalname, physicaldate, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, deptcode, deptname, projectname, projectcode, state, schemestatus, generalschemestatus, deptid, projectid, schemetime from pat_med_physical
    </sql>
    <select id="selectPatMedPhysicalList" parameterType="PatMedPhysical" resultMap="PatMedPhysicalResult">
    <select id="selectPatMedPhysicalList" parameterType="com.smartor.domain.PatMedPhysical" resultMap="PatMedPhysicalResult">
        <include refid="selectPatMedPhysicalVo"/>
        <where>
        <where>
            <if test="hospitalname != null  and hospitalname != ''"> and hospitalname like concat('%', #{hospitalname}, '%')</if>
            <if test="physicaldate != null "> and physicaldate = #{physicaldate}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="patno != null  and patno != ''"> and patno = #{patno}</if>
            <if test="deptname != null  and deptname != ''"> and deptname like concat('%', #{deptname}, '%')</if>
            <if test="patname != null  and patname != ''"> and patname like concat('%', #{patname}, '%')</if>
            <if test="projectname != null  and projectname != ''"> and projectname like concat('%', #{projectname}, '%')</if>
        </where>
    </select>
    <select id="selectPatMedPhysicalById" parameterType="Long" resultMap="PatMedPhysicalResult">
        <include refid="selectPatMedPhysicalVo"/>
        where id = #{id}
    </select>
    <insert id="insertPatMedPhysical" parameterType="PatMedPhysical" useGeneratedKeys="true" keyProperty="id">
        insert into pat_med_physical
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -81,6 +85,8 @@
            <if test="deptid != null">deptid,</if>
            <if test="projectid != null">projectid,</if>
            <if test="schemetime != null">schemetime,</if>
            <if test="patname != null">patname,</if>
            <if test="patno != null">patno,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serialnum != null">#{serialnum},</if>
@@ -108,6 +114,8 @@
            <if test="deptid != null">#{deptid},</if>
            <if test="projectid != null">#{projectid},</if>
            <if test="schemetime != null">#{schemetime},</if>
            <if test="patname != null">#{patname},</if>
            <if test="patno != null">#{patno},</if>
         </trim>
    </insert>
@@ -139,6 +147,8 @@
            <if test="deptid != null">deptid = #{deptid},</if>
            <if test="projectid != null">projectid = #{projectid},</if>
            <if test="schemetime != null">schemetime = #{schemetime},</if>
            <if test="patname != null">patname = #{patname},</if>
            <if test="patno != null">patno = #{patno},</if>
        </trim>
        where id = #{id}
    </update>
@@ -148,9 +158,9 @@
    </delete>
    <delete id="deletePatMedPhysicalByIds" parameterType="String">
        delete from pat_med_physical where id in
        delete from pat_med_physical where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
</mapper>