NationalMatchDao.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. package thyyxxk.webserver.dao.his.nationalmatch;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import org.apache.ibatis.annotations.Update;
  7. import thyyxxk.webserver.entity.nationalmatch.*;
  8. import java.util.List;
  9. /**
  10. * @description: 新医保国家目录匹配mapper
  11. * @author: DingJie
  12. * @create: 2021-06-10 14:49:56
  13. **/
  14. @Mapper
  15. public interface NationalMatchDao {
  16. @Select("select a.code,a.serial,a.new_name as name,type=#{type}," +
  17. "a.national_code,a.national_name,a.uploaded_flag, " +
  18. "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
  19. "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
  20. "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
  21. "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
  22. "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=#{delFlag} " +
  23. "and isnull(del_flag,0)=#{delFlag} group by code) b,yp_base c " +
  24. "where isnull(national_status,0)=#{status} and a.code=b.code and a.serial=b.serial " +
  25. "and c.group_no=11 and a.code=c.charge_code and a.drug_kind in (select code from yp_zd_drug_kind where yp_type in (1,2)) " +
  26. "and a.code like #{code} and a.name like #{name}")
  27. IPage<StandardLocalItem> selectLocalMedicines(IPage<StandardLocalItem> iPage,
  28. @Param("code") String code,
  29. @Param("name") String name,
  30. @Param("type") int type,
  31. @Param("delFlag") int delFlag,
  32. @Param("status") int status);
  33. @Select("select a.code,a.serial,a.new_name as name,type=#{type}," +
  34. "a.national_code,a.national_name,a.uploaded_flag, " +
  35. "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
  36. "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
  37. "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
  38. "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
  39. "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=#{delFlag} " +
  40. "and isnull(del_flag,0)=#{delFlag} group by code) b,yp_base c " +
  41. "where isnull(national_status,0)=#{status} and a.code=b.code and a.serial=b.serial " +
  42. "and c.group_no=22 and a.code=c.charge_code and a.drug_kind in ('0007','0003') " +
  43. "and a.code like #{code} and a.name like #{name} ")
  44. IPage<StandardLocalItem> selectLocalHerbals(IPage<StandardLocalItem> iPage,
  45. @Param("code") String code,
  46. @Param("name") String name,
  47. @Param("type") int type,
  48. @Param("delFlag") int delFlag,
  49. @Param("status") int status);
  50. @Select("select code,new_name as name,charge_unit as unit,type=#{type},discription,specification," +
  51. "national_code,uploaded_flag,national_name,yb_comment as factory from zd_charge_item " +
  52. "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
  53. "class_code='J' and code like #{code} and name like #{name}")
  54. IPage<StandardLocalItem> selectLocalSupplies(IPage<StandardLocalItem> iPage,
  55. @Param("code") String code,
  56. @Param("name") String name,
  57. @Param("type") int type,
  58. @Param("delFlag") int delFlag,
  59. @Param("status") int status);
  60. @Select("select code,new_name as name,charge_unit as unit,type=#{type}, discription,specification,uploaded_flag," +
  61. "national_code,national_name,s_code as standardCode, charge_amount as price, " +
  62. "localName=(select b.local_medical_service_name from si_central_services b where b.national_code=a.national_code) " +
  63. "from zd_charge_item a " +
  64. "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
  65. "class_code!='J' and code like #{code} and name like #{name}")
  66. IPage<StandardLocalItem> selectLocalServices(IPage<StandardLocalItem> iPage,
  67. @Param("code") String code,
  68. @Param("name") String name,
  69. @Param("type") int type,
  70. @Param("delFlag") int delFlag,
  71. @Param("status") int status);
  72. @Update("update zd_charge_item set new_name=name where new_name is null")
  73. void asyncNewNameForServices();
  74. @Select("select code as nationalCode,drug_trade_name as nationalName,drug_dosage_forms as actualDosage, " +
  75. "specifications=(drug_specifications+' x'+minimum_packing_quantity+minimum_preparation_unit+'/'+minimum_packing_unit), " +
  76. "packaging_material as packingMaterial,production_name as factory,license_number as approvalNumber, " +
  77. "drug_supervision_local_code as drugStandardCode from t_si_dl_ptnt_wstn_mdcn " +
  78. "where drug_trade_name=#{name} and license_number like #{approve}")
  79. List<SiCentralMedicine> selectNationalMedicines(@Param("name") String name,
  80. @Param("approve") String approve);
  81. @Select("select code as nationalCode,monoo_name as nationalName,start_time,end_time " +
  82. "from t_si_dl_chns_hbl where monoo_name like #{name}")
  83. List<SiCentralHerbal> selectNationalHerbals(@Param("name") String name);
  84. @Select("select code as nationalCode,service_name as nationalName,isnull(connotation,'') as projectConnotation, " +
  85. "exclude_content as exclusions,charge_unit as valuationUnit,entry_specification as projectDescription, " +
  86. "start_date,end_date from t_si_dl_mdcn_srvc where service_name like #{name}")
  87. List<SiCentralServices> selectNationalServices(@Param("name") String name);
  88. @Select("select code as nationalCode,supplies_name as nationalName,si_universal_name as siName, " +
  89. "consumable_material as material,isnull(production_name,'') as factory,start_time,end_time " +
  90. "from t_si_dl_mdcn_sply where supplies_name like #{name} or si_universal_name like #{name}")
  91. List<SiCentralSuppliesMini> selectNationalSupplies(@Param("name") String name);
  92. @Update("update yp_zd_dict set national_status=1,national_code=#{nationalCode}," +
  93. "national_name=#{nationalName},match_oper=#{staffId}, match_date=getdate() " +
  94. "where code=#{code}")
  95. void matchMedicineAndHerbal(@Param("code") String code,
  96. @Param("staffId") String staffId,
  97. @Param("nationalCode") String nationalCode,
  98. @Param("nationalName") String nationalName);
  99. @Update("update zd_charge_item set national_status=1,national_code=#{nationalCode}," +
  100. "national_name=#{nationalName},match_oper=#{staffId},match_date=getdate() " +
  101. "where code=#{code}")
  102. void matchServcieAndSupply(@Param("code") String code,
  103. @Param("staffId") String staffId,
  104. @Param("nationalCode") String nationalCode,
  105. @Param("nationalName") String nationalName);
  106. @Update("update yp_zd_dict set national_status=0,national_code='',national_name='',cancel_match_oper=#{staffId}," +
  107. "cancel_match_date=getdate() where code=#{code} and serial=#{serial}")
  108. void cancelMatchYp(@Param("code") String code,
  109. @Param("serial") String serial,
  110. @Param("staffId") String staffId);
  111. @Update("update zd_charge_item set national_status=0,national_code='',national_name='',cancel_match_oper=#{staffId}," +
  112. "cancel_match_date=getdate() where code=#{code}")
  113. void cancelMatchXm(@Param("code") String code,
  114. @Param("staffId") String staffId);
  115. @Update("update yp_zd_dict set new_name=#{name},oper_id=#{staffId},oper_date=getdate() where code=#{code}")
  116. void updateMedicine(@Param("name") String name,
  117. @Param("staffId") String staffId,
  118. @Param("code") String code);
  119. @Update("update zd_charge_item set new_name=#{name},charge_unit=#{unit},charge_amount=#{price}," +
  120. "oper_id=#{staffId},s_code=#{standardCode},discription=#{discription}," +
  121. "oper_date=getdate() where code=#{code}")
  122. void updateServiceItem(@Param("name") String name,
  123. @Param("unit") String unit,
  124. @Param("price") String price,
  125. @Param("staffId") String staffId,
  126. @Param("standardCode") String standardCode,
  127. @Param("discription") String discription,
  128. @Param("code") String code);
  129. @Update("update zd_charge_item set new_name=#{name},oper_id=#{staffId},yb_comment=#{factory}," +
  130. "specification=#{specification},oper_date=getdate() where code=#{code}")
  131. void updateSupply(@Param("name") String name,
  132. @Param("staffId") String staffId,
  133. @Param("factory") String factory,
  134. @Param("specification") String specification,
  135. @Param("code") String code);
  136. }