package thyyxxk.webserver.dao.his.datamodify; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import thyyxxk.webserver.entity.datamodify.ZyDetailCharge; /** *
* Mapper 接口 *
* * @author 肖蟾 * @description: 住院费用修改 * @since 2021-03-13 */ @Mapper public interface ZyDetailChargeDao { /** * 修改单个住院费用的 金额 * * @param data 需要修改的数据 * @return 数据 */ @Update("update zy_detail_charge set charge_fee = #{newChargeFee} " + "where inpatient_no=#{inpatientNo} and detail_sn=#{detailSn} " + "and admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn} ") boolean totalModify(ZyDetailCharge data); /** * 根据条件 来查询 住院费用 * * @param page 分页的条件 * @param chargeCodeMx 收费项目码 * @param inpatientNo 住院号 */ @Select("select admiss_times,ledger_sn,detail_sn,charge_date,rtrim(inpatient_no) as inpatient_no," + "a.serial,infant_flag,charge_status, " + "op_id_code=rtrim((select name from a_employee_mi where code=op_id_code)), " + "case when ((select name from zd_charge_item where code = charge_code_mx) is null) then (b.name) " + "else (select name from zd_charge_item where code = charge_code_mx ) " + "end as charge_code, " + "charge_fee,a.self_flag, " + "ward_code=(select name from zd_unit_code where code = ward_code), " + "dept_code=(select name from zd_unit_code where code = dept_code), " + "order_no,ope_flag, " + "exec_unit=(select name from zd_unit_code where code=exec_unit), " + "gen_time,a.charge_code_mx,charge_amount " + "from zy_detail_charge as a " + "inner join yp_zd_dict as b on (a.charge_code_mx = code and a.serial = b.serial) " + "where inpatient_no=#{inpatientNo} and charge_code_mx=#{chargeCodeMx} and " + "admiss_times=(select admiss_times from zy_actpatient where inpatient_no=a.inpatient_no) " + "and ledger_sn=(select max(ledger_sn) from zy_ledger_file where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times)") void queryHospitalizationExpenses(IPage