| | |
| | | ) |
| | | </select> |
| | | |
| | | <resultMap id="SpStatChangeDetailResult" type="com.ruoyi.project.domain.SpStatChangeDetail"> |
| | | <result property="donatetime" column="donatetime"/> |
| | | <result property="donorname" column="donorname"/> |
| | | <result property="organno" column="OrganNo"/> |
| | | <result property="organname" column="OrganName"/> |
| | | <result property="name" column="name"/> |
| | | <result property="caseno" column="caseno"/> |
| | | <result property="hospitalname" column="HospitalName"/> |
| | | <result property="organcharge" column="organcharge"/> |
| | | <result property="amount" column="amount"/> |
| | | <result property="nonpayment" column="nonpayment"/> |
| | | </resultMap> |
| | | |
| | | <select id="getSpStatChangeDetail" resultMap="SpStatChangeDetailResult"> |
| | | select b.donatetime, |
| | | o.donorname, |
| | | o.OrganNo, |
| | | o.OrganName, |
| | | o.name, |
| | | o.caseno, |
| | | o.HospitalName, |
| | | o.organcharge, |
| | | o.amount, |
| | | (ifnull(o.organcharge, 0) - ifnull(o.amount, 0)) as nonpayment |
| | | from service_donorchargeorgan o |
| | | left join service_donatebaseinfo b on b.ID = o.InfoID |
| | | where o.del_flag = 0 |
| | | <if test="PABEGTIME != null and PABEGTIME != ''">and b.donatetime >= #{PABEGTIME}</if> |
| | | <if test="PAENDTIME != null and PAENDTIME != ''">and b.donatetime <= #{PAENDTIME}</if> |
| | | <if test="PAHOSPITALNAME != null and PAHOSPITALNAME != ''">and o.HospitalName = #{PAHOSPITALNAME}</if> |
| | | <if test='"1".equals(PACHARGESTATE)'>and ifnull(o.amount, 0) > 0</if> |
| | | <if test='"0".equals(PACHARGESTATE)'>and (ifnull(o.organcharge, 0) - ifnull(o.amount, 0)) > 0</if> |
| | | order by b.donatetime |
| | | </select> |
| | | |
| | | </mapper> |