NationalMatchDao.java 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.name,type=#{type},a.national_code,a.national_name, " +
  17. "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
  18. "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
  19. "a.specification,rtrim(a.pzwh) as approvalNumber, " +
  20. "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
  21. "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=#{delFlag} " +
  22. "and isnull(del_flag,0)=#{delFlag} group by code) b,yp_base c " +
  23. "where isnull(national_status,0)=#{status} and a.code=b.code and a.serial=b.serial " +
  24. "and c.group_no=#{groupNo} and a.code=c.charge_code and a.code like #{code} and a.name like #{name}")
  25. IPage<StandardLocalItem> selectLocalMedicines(IPage<StandardLocalItem> iPage,
  26. @Param("code") String code,
  27. @Param("name") String name,
  28. @Param("type") int type,
  29. @Param("delFlag") int delFlag,
  30. @Param("status") int status,
  31. @Param("groupNo") int groupNo);
  32. @Select("select code,name,charge_unit as unit,type=#{type}, discription as specification,national_code," +
  33. "national_name,yb_comment as factory from zd_charge_item where isnull(national_status,0)=#{status} " +
  34. "and isnull(del_flag,0)=#{delFlag} and class_code='J' and code like #{code} and name like #{name}")
  35. IPage<StandardLocalItem> selectLocalSupplies(IPage<StandardLocalItem> iPage,
  36. @Param("code") String code,
  37. @Param("name") String name,
  38. @Param("type") int type,
  39. @Param("delFlag") int delFlag,
  40. @Param("status") int status);
  41. @Select("select code,new_name as name,charge_unit as unit,type=#{type}, discription as specification," +
  42. "national_code,national_name,s_code as standardCode, charge_amount as price from zd_charge_item " +
  43. "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
  44. "class_code!='J' and code like #{code} and name like #{name}")
  45. IPage<StandardLocalItem> selectLocalServices(IPage<StandardLocalItem> iPage,
  46. @Param("code") String code,
  47. @Param("name") String name,
  48. @Param("type") int type,
  49. @Param("delFlag") int delFlag,
  50. @Param("status") int status);
  51. @Update("update zd_charge_item set new_name=name where new_name is null")
  52. void asyncNewNameForServices();
  53. @Select("select * from si_central_medicine where national_name=#{name} and approval_number like #{approve}")
  54. List<SiCentralMedicine> selectNationalMedicines(@Param("name") String name,
  55. @Param("approve") String approve);
  56. @Select("select * from si_central_herbal where national_name=#{name}")
  57. List<SiCentralHerbal> selectNationalHerbals(@Param("name") String name);
  58. @Select("select * from si_central_services where national_name=#{name} " +
  59. "or local_medical_service_name like #{name}")
  60. List<SiCentralServices> selectNationalServices(@Param("name") String name);
  61. @Select("select * from si_central_supplies_mini where national_name like #{name}")
  62. List<SiCentralSuppliesMini> selectNationalSupplies(@Param("name") String name);
  63. @Update("update yp_zd_dict set national_status=1,national_code=#{nationalCode}," +
  64. "national_name=#{nationalName},match_oper=#{staffId}, match_date=getdate() " +
  65. "where code=#{code}")
  66. void matchMedicineAndHerbal(@Param("code") String code,
  67. @Param("staffId") String staffId,
  68. @Param("nationalCode") String nationalCode,
  69. @Param("nationalName") String nationalName);
  70. @Update("update zd_charge_item set national_status=1,national_code=#{nationalCode}," +
  71. "national_name=#{nationalName},match_oper=#{staffId},match_date=getdate() " +
  72. "where code=#{code}")
  73. void matchServcieAndSupply(@Param("code") String code,
  74. @Param("staffId") String staffId,
  75. @Param("nationalCode") String nationalCode,
  76. @Param("nationalName") String nationalName);
  77. @Update("update yp_zd_dict set national_status=0,national_code='',national_name='',cancel_match_oper=#{staffId}," +
  78. "cancel_match_date=getdate() where code=#{code} and serial=#{serial}")
  79. void cancelMatchYp(@Param("code") String code,
  80. @Param("serial") String serial,
  81. @Param("staffId") String staffId);
  82. @Update("update zd_charge_item set national_status=0,national_code='',national_name='',cancel_match_oper=#{staffId}," +
  83. "cancel_match_date=getdate() where code=#{code}")
  84. void cancelMatchXm(@Param("code") String code,
  85. @Param("staffId") String staffId);
  86. @Update("update yp_zd_dict set new_name=#{name},oper_id=#{staffId},oper_date=getdate() where code=#{code}")
  87. void updateMedicine(@Param("name") String name,
  88. @Param("staffId") String staffId,
  89. @Param("code") String code);
  90. @Update("update zd_charge_item set new_name=#{name},charge_unit=#{unit},charge_amount=#{price},oper_id=#{staffId}," +
  91. "s_code=#{standardCode},discription=#{discription},oper_date=getdate() where code=#{code}")
  92. void updateServiceItem(@Param("name") String name,
  93. @Param("unit") String unit,
  94. @Param("price") String price,
  95. @Param("staffId") String staffId,
  96. @Param("standardCode") String standardCode,
  97. @Param("discription") String discription,
  98. @Param("code") String code);
  99. }