liusheng
2024-07-25 517ecf9879052b2f3fbad25c0469935cc45553a7
ruoyi-project/src/main/resources/mapper/project/ServiceDonatecompletioninfoMapper.xml
@@ -28,10 +28,32 @@
    </resultMap>
    <sql id="selectServiceDonatecompletioninfoVo">
        select ID, InfoID, DonorNo, del_flag, create_by, create_time, update_by, update_time, IsBodyDonation, ReceivingUnit, ReceivingUnitName, CompleteTime, ResponsibleUserID, ResponsibleUserName, CoordinatedUserIDO, CoordinatedUserNameO, CoordinatedUserIDT, CoordinatedUserNameT, AssessAnnex, DonateOrgan from service_donatecompletioninfo
        select ID,
               InfoID,
               DonorNo,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               IsBodyDonation,
               ReceivingUnit,
               ReceivingUnitName,
               CompleteTime,
               ResponsibleUserID,
               ResponsibleUserName,
               CoordinatedUserIDO,
               CoordinatedUserNameO,
               CoordinatedUserIDT,
               CoordinatedUserNameT,
               AssessAnnex,
               DonateOrgan
        from service_donatecompletioninfo
    </sql>
    <select id="selectServiceDonatecompletioninfoList" parameterType="com.ruoyi.project.domain.ServiceDonatecompletioninfo" resultMap="ServiceDonatecompletioninfoResult">
    <select id="selectServiceDonatecompletioninfoList"
            parameterType="com.ruoyi.project.domain.ServiceDonatecompletioninfo"
            resultMap="ServiceDonatecompletioninfoResult">
        <include refid="selectServiceDonatecompletioninfoVo"/>
        <where>
            <if test="donorno != null  and donorno != ''"> and DonorNo = #{donorno}</if>
@@ -97,27 +119,32 @@
        `service_donatecompletioninfo`.`update_by` AS `updateby`,
        `service_donatecompletioninfo`.`update_time` AS `updatetime`
    FROM
              `service_donatebaseinfo`
            LEFT JOIN  (    select * from `service_donatecompletioninfo`  where `del_flag`='0' and  id in (
                select min(id) from `service_donatecompletioninfo` where `del_flag`='0' group by `InfoID`
                )  )`service_donatecompletioninfo` ON
        LEFT JOIN `service_donatecompletioninfo` ON
                `service_donatebaseinfo`.`ID` = `service_donatecompletioninfo`.`InfoID`
        LEFT JOIN `base_organization` ON
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            `service_donatebaseinfo`.`del_flag` = 0
            and service_donatecompletioninfo.del_flag = 0
            <if test="donorno != null  and donorno != ''"> and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''"> and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')</if>
            <if test="name != null  and name != ''">and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')
            </if>
            <if test="idcardno != null  and idcardno != ''"> and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''"> and `service_donatebaseinfo`.`TreatmentHospitalNo` = #{treatmenthospitalno}</if>
            <if test="recordstate != null  and recordstate != ''"> and `service_donatebaseinfo`.`RecordState` = #{recordstate}</if>
            <if test="basecreateby != null  and basecreateby != ''"> and `service_donatebaseinfo`.`create_by` = #{basecreateby}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''">and
                `service_donatebaseinfo`.`TreatmentHospitalNo` = #{treatmenthospitalno}
            </if>
            <if test="recordstate != null  and recordstate != ''">and `service_donatebaseinfo`.`RecordState` =
                #{recordstate}
            </if>
            <if test="basecreateby != null  and basecreateby != ''">and `service_donatebaseinfo`.`create_by` =
                #{basecreateby}
            </if>
            <if test="starttime != null "> and `service_donatecompletioninfo`.CompleteTime >= #{starttime} </if>
            <if test="endtime != null ">  and `service_donatecompletioninfo`.CompleteTime &lt;= #{endtime}</if>
            <if test="reporterno != null  and reporterno != ''"> and `service_donatebaseinfo`.ReporterNo = #{reporterno}</if>
            <if test="reporterno != null  and reporterno != ''">and `service_donatebaseinfo`.ReporterNo =
                #{reporterno}
            </if>
            <if test="city != null and city != ''"> and `base_organization`.`City` = #{city}</if>
            <if test="id != null "> and `service_donatebaseinfo`.`ID` = #{id}</if>
            <if test="workflow != null "> and `service_donatebaseinfo`.`workflow` = #{workflow}</if>
@@ -128,16 +155,22 @@
    </select>
    <select id="countNumber" resultType="java.lang.Integer">
        select count(*) from service_donatecompletioninfo
        where CompleteTime >= #{starttime} and CompleteTime &lt;= #{endtime}  AND del_flag=0
        select count(*)
        from service_donatecompletioninfo
        where CompleteTime >= #{starttime}
          and CompleteTime &lt;= #{endtime}
          AND del_flag = 0
    </select>
    <select id="getByInfoId" resultType="com.ruoyi.project.domain.ServiceDonatecompletioninfo">
        <include refid="selectServiceDonatecompletioninfoVo"/>
        where InfoID = #{id}  AND del_flag=0
    </select>
    <select id="count" resultType="java.lang.Integer">
        select count(*) from service_donatecompletioninfo
        where del_flag=0 and CompleteTime >= #{starttime} and CompleteTime &lt;= #{endtime}
        select count(*)
        from service_donatecompletioninfo
        where del_flag = 0
          and CompleteTime >= #{starttime}
          and CompleteTime &lt;= #{endtime}
    </select>
    <select id="getCompletionDonatePeopleByTime" resultType="com.ruoyi.project.domain.ServiceDonatecompletioninfo">
        <include refid="selectServiceDonatecompletioninfoVo"/>
@@ -147,7 +180,9 @@
    <update id="delDuplicateDonateCompletioninfo">
        update service_donatecompletioninfo
        set del_flag = 1,create_by= #{createby},update_time=now()
        set del_flag   = 1,
            create_by= #{createby},
            update_time=now()
        where InfoID = #{infoid}
    </update>