sinake
10 天以前 d5a5416a0e4b1e52c7805e3efc28eec40ab95782
ruoyi-project/src/main/resources/mapper/project/ServiceTotalsMapper.xml
@@ -10,7 +10,7 @@
        LEFT JOIN  service_donatecompletioninfo  b ON b.InfoID=a.id
        <where>
            a.del_flag=0
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -23,7 +23,7 @@
        LEFT JOIN  service_donatecompletioninfo  b ON b.InfoID=a.id
        <where>
            a.del_flag=0
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -36,7 +36,7 @@
        LEFT JOIN  service_donatecompletioninfo  b ON b.InfoID=a.id
        <where>
            a.del_flag=0
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -46,16 +46,18 @@
    <select id="organ" parameterType="com.ruoyi.project.domain.ServiceTotals"
            resultType="ServiceTotalsOrgan">
        SELECT DATE_FORMAT(a.organ_start_time, '%Y-%m') donateTime,a.OrganName organName, COUNT(*) getCount,c.RegisterCountyName area,
        COUNT(IF(transplantstate=3, true, NULL)) useCount   FROM  service_donationwitnessorgan a
        COUNT(IF(b.transplantstate=3, true, NULL)) useCount ,COUNT(IF(d.complete_state=4, true, NULL)) deprecateCount
        FROM  service_donationwitnessorgan a
        LEFT JOIN  service_donatecomporgan b ON a.InfoID=b.InfoID AND a.OrganName=b.OrganName
        LEFT JOIN  service_donatebaseinfo c ON a.InfoID=c.ID
        LEFT JOIN  service_donatecompletioninfo d ON d.InfoID=a.InfoID
        <where>
            a.del_flag=0
            a.del_flag=0 and b.del_flag=0 and c.del_flag=0 and d.del_flag=0
            <if test="area != null  and area != ''">
                and a.InfoID in (select id FROM service_donatecompletioninfo where RegisterCountyName>=#{area} )
            </if>
            <if test="area != null  and area != ''">and c.RegisterCountyName>=#{area}</if>
            <if test="organName != null  and organName != ''">and a.OrganName>=#{organName}</if>
            <if test="area != null  and area != ''">and c.RegisterCountyName=#{area}</if>
            <if test="organName != null  and organName != ''">and a.OrganName=#{organName}</if>
            <if test="startTime != null  and startTime != ''">and a.organ_start_time>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.organ_start_time &lt;= #{endTime}</if>
        </where>
@@ -72,7 +74,7 @@
            <if test="area != null  and area != ''">
                and a.InfoID in (select id FROM service_donatecompletioninfo where RegisterCountyName>=#{area} )
            </if>
            <if test="organName != null  and organName != ''">and a.OrganName>=#{organName}</if>
            <if test="organName != null  and organName != ''">and a.OrganName=#{organName}</if>
            <if test="startTime != null  and startTime != ''">and a.organ_start_time>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.organ_start_time &lt;= #{endTime}</if>
        </where>
@@ -89,7 +91,7 @@
            <if test="area != null  and area != ''">
                and a.InfoID in (select id FROM service_donatecompletioninfo where RegisterCountyName>=#{area} )
            </if>
            <if test="organName != null  and organName != ''">and a.OrganName>=#{organName}</if>
            <if test="organName != null  and organName != ''">and a.OrganName=#{organName}</if>
            <if test="startTime != null  and startTime != ''">and a.organ_start_time>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.organ_start_time &lt;= #{endTime}</if>
        </where>
@@ -180,7 +182,7 @@
        LEFT JOIN service_deathinfo d ON d.InfoID=a.id
        <where>
            a.del_flag=0
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -194,7 +196,7 @@
        LEFT JOIN service_deathinfo d ON d.InfoID=a.id
        <where>
            a.del_flag=0
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -211,14 +213,14 @@
    <select id="organList" parameterType="com.ruoyi.project.domain.ServiceTotals"
            resultType="organList">
        SELECT a.id,a.case_no,a.NAME,a.RegisterCountyName,YEAR(a.donatetime) donateYear,b.OrganName,b.transplantstate,
        SELECT DISTINCT a.id,a.case_no,a.NAME,a.RegisterCountyName,YEAR(a.donatetime) donateYear,b.OrganName,b.transplantstate,
        b.TransplantTime,b.Name,b.TransplantDoct,b.HospitalName,c.OrganGetTime,c.notgetreason
        FROM service_donatebaseinfo a LEFT JOIN service_donatecomporgan b ON a.ID=b.InfoID
        LEFT JOIN service_donationwitnessorgan c ON a.ID=c.InfoID
        <where>
            a.del_flag=0 AND b.del_flag=0 AND c.del_flag=0
            <if test="organName != null  and organName != ''">and b.OrganName>=#{organName}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="organName != null  and organName != ''">and b.OrganName=#{organName}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>
@@ -232,8 +234,8 @@
        LEFT JOIN service_donationwitnessorgan c ON a.ID=c.InfoID
        <where>
            a.del_flag=0 AND b.del_flag=0 AND c.del_flag=0
            <if test="organName != null  and organName != ''">and b.OrganName>=#{organName}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName>=#{area}</if>
            <if test="organName != null  and organName != ''">and b.OrganName=#{organName}</if>
            <if test="area != null  and area != ''">and a.RegisterCountyName=#{area}</if>
            <if test="startTime != null  and startTime != ''">and a.donatetime>=#{startTime}</if>
            <if test="endTime != null  and endTime != ''">and a.donatetime &lt;= #{endTime}</if>
        </where>