package thyyxxk.webserver.dao.his.medicine; 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.YpInDetl; import thyyxxk.webserver.entity.datamodify.YpOutDetl; import thyyxxk.webserver.entity.medicalinsurance.manage.inventory.SelinfoSold; import thyyxxk.webserver.entity.medicine.YpCodgUpload; import thyyxxk.webserver.entity.medicine.YpInvinfoModify; import thyyxxk.webserver.entity.medicine.YpPurcinfoBought; import thyyxxk.webserver.entity.medicine.YpSelinfoSold; import thyyxxk.webserver.entity.medicine.YpZdSupply; import java.util.List; import java.util.Map; @Mapper public interface YpTracCodgDao { @Select(" select group_no as value, group_name as label from yp_zd_group_name where yf_flag = '1' order by group_no ") List> selectGroupNoInfoYf(); @Select(" select group_no as value, group_name as label from yp_zd_group_name where yf_flag = '0' order by group_no ") List> selectGroupNoInfoYk(); @Select(" select ltrim(code) as value, ltrim(name) as label, supply_code as code from yp_zd_supply where isnull(del_flag, '0') = '0' ") List> selectSupplyType(); @Select(" select top 1 * from yp_zd_supply where isnull(del_flag, '0') = '0' and supply_code = #{supplyCode} ") YpZdSupply selectSupplyTypeBySupplyCode(@Param("supplyCode") String supplyCode); @Select("") List selectYpPurchaseGoodsDetail(@Param("dto") YpCodgUpload dto); @Select("") List selectYpPurchaseGoodsTkDetail(@Param("dto") YpCodgUpload dto); @Select(" select count(*) c from yp_in_detl where in_docu_no = #{inDocuNo} and in_seri = #{inSeri} and charge_code = #{chargeCode} and serial = #{serial} ") int selectYpInvoiceData(@Param("inDocuNo") String inDocuNo, @Param("inSeri") String inSeri, @Param("chargeCode") String chargeCode, @Param("serial") String serial); @Update(" update yp_in_detl set fp_no = #{fpNo} where in_docu_no = #{inDocuNo} and in_seri = #{inSeri} and charge_code = #{chargeCode} and serial = #{serial} ") int updateYpInvoice(@Param("inDocuNo") String inDocuNo, @Param("inSeri") String inSeri, @Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("fpNo") String fpNo); @Select(" select top 10 * from yp_in_detl ") List selectYpSaleGoodsData(@Param("inDocuNo") String inDocuNo, @Param("hisId") String hisId, @Param("hisName") String hisName); @Select("") List selectYpSelinfoSoldDetailByXyf(@Param("dto") YpCodgUpload dto); @Select("") List selectYpSelinfoSoldThDetailByXyf(@Param("dto") YpCodgUpload dto); @Select("") List selectYpSelinfoSoldThDetailByXyfOld(@Param("dto") YpCodgUpload dto); @Select(" select drug_trac_codg as ypCodg, charge_item_code as chargeCode, convert(varchar(100), confirm_time, 20) as confirmTime, match_flag as matchFlag from ${tableName} " + " where flag = '0' and patient_id = #{patNo} and times = #{times} and charge_item_code = #{chargeCode} and serial = #{serial} ") List> selectCodgInfoById(@Param("tableName") String tableName, @Param("patNo") String patNo, @Param("times") Integer times, @Param("chargeCode") String chargeCode, @Param("serial") String serial); @Select(" select top 1 * from yp_out_detl where confirm_flag = '1' and out_type = '0' and charge_code = #{chargeCode} and group_no_out = #{groupNo} order by out_date desc ") YpOutDetl selectCodgInfoManu(@Param("chargeCode") String chargeCode, @Param("groupNo") String groupNo); @Select(" select top 1 * from yp_in_detl where confirm_flag = '1' and in_type in ('0', '1') and charge_code = #{chargeCode} " + "and serial = #{serial} and manu_no = #{manuNo} and in_date <= #{confirmTime} order by in_date desc ") YpInDetl selectCodgInfoProdTime(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("manuNo") String manuNo, @Param("confirmTime") String confirmTime); @Select("") List selectYpInvinfoModifyDetailRk(@Param("dto") YpCodgUpload dto); @Select("") List selectYpInvinfoModifyDetailCk(@Param("dto") YpCodgUpload dto); @Select(" select * from powersi_mip_setlinfo where med_org_ord = #{id} ") Map selectMobileSetlInfoById(@Param("id") String id); }