sinake
18 小时以前 b88b42be258535e65d38888823ac85fd8467b571
ruoyi-project/src/main/resources/mapper/project/ServiceDonorchargeorganMapper.xml
@@ -213,4 +213,39 @@
        )
    </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 &gt;= #{PABEGTIME}</if>
        <if test="PAENDTIME != null and PAENDTIME != ''">and b.donatetime &lt;= #{PAENDTIME}</if>
        <if test="PAHOSPITALNAME != null and PAHOSPITALNAME != ''">and o.HospitalName = #{PAHOSPITALNAME}</if>
        <if test='"1".equals(PACHARGESTATE)'>and ifnull(o.amount, 0) &gt; 0</if>
        <if test='"0".equals(PACHARGESTATE)'>and (ifnull(o.organcharge, 0) - ifnull(o.amount, 0)) &gt; 0</if>
        order by b.donatetime
    </select>
</mapper>