| | |
| | | |
| | | <select id="organ" parameterType="com.ruoyi.project.domain.ServiceTotals" |
| | | resultType="ServiceTotalsOrgan"> |
| | | SELECT DATE_FORMAT(a.OrganGetTime, '%Y-%m') donateTime,a.OrganName organName, COUNT(*) getCount, |
| | | 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 |
| | | 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 |
| | | <where> |
| | | a.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="startTime != null and startTime != ''">and a.OrganGetTime>=#{startTime}</if> |
| | | <if test="endTime != null and endTime != ''">and a.OrganGetTime <= #{endTime}</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 <= #{endTime}</if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(a.OrganGetTime, '%Y-%m'),a.OrganName |
| | | GROUP BY DATE_FORMAT(a.organ_start_time, '%Y-%m'),a.OrganName,c.RegisterCountyName |
| | | </select> |
| | | |
| | | <select id="organMoon" parameterType="com.ruoyi.project.domain.ServiceTotals" |
| | | resultType="ServiceTotalsOrgan"> |
| | | SELECT DATE_FORMAT(a.OrganGetTime, '%Y-%m') donateTime, COUNT(*) getCount, |
| | | SELECT DATE_FORMAT(a.organ_start_time, '%Y-%m') donateTime, COUNT(*) getCount, |
| | | COUNT(IF(transplantstate=3, true, NULL)) useCount FROM service_donationwitnessorgan a |
| | | LEFT JOIN service_donatecomporgan b ON a.InfoID=b.InfoID AND a.OrganName=b.OrganName |
| | | <where> |
| | |
| | | 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="startTime != null and startTime != ''">and a.OrganGetTime>=#{startTime}</if> |
| | | <if test="endTime != null and endTime != ''">and a.OrganGetTime <= #{endTime}</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 <= #{endTime}</if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(a.OrganGetTime, '%Y-%m') |
| | | GROUP BY DATE_FORMAT(a.organ_start_time, '%Y-%m') |
| | | </select> |
| | | |
| | | <select id="organType" parameterType="com.ruoyi.project.domain.ServiceTotals" |
| | |
| | | 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="startTime != null and startTime != ''">and a.OrganGetTime>=#{startTime}</if> |
| | | <if test="endTime != null and endTime != ''">and a.OrganGetTime <= #{endTime}</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 <= #{endTime}</if> |
| | | </where> |
| | | GROUP BY a.OrganName |
| | | </select> |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="organTotals" parameterType="com.ruoyi.project.domain.ServiceTotals" |
| | | resultType="ServiceTotalsOrganTotals"> |
| | | SELECT ( SELECT COUNT(*) FROM service_donatecomporgan WHERE del_flag=0 AND transplantstate=1) totalTransplant, |
| | | ( SELECT COUNT(*) FROM service_donatecomporgan WHERE del_flag=0 AND transplantstate=4) totalDiscard, |
| | | (SELECT COUNT(*) FROM service_donationwitnessorgan WHERE del_flag=0 AND OrganState=3) totalGet, |
| | | (SELECT COUNT(*) FROM service_donationwitnessorgan WHERE del_flag=0 AND OrganState=4) totalRecycle |
| | | </select> |
| | | |
| | | </mapper> |