NationalMatchDao.java 11 KB

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