<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yida.data.mall.mapper.EduBillItemMapper">
	
	<!-- 根据是否缴费类型查询金额 -->
	<select id="selectMoneyByStatus"
			resultType="java.math.BigDecimal">
		SELECT
			IFNULL( SUM( item_price ), 0 ) AS price
		FROM
			edu_bill_item
		WHERE
			del_flag = 0
		AND bill_id = #{billId}
		<if test='status != null'>
			AND must_pay = #{status}
		</if>
	</select>
</mapper>
