YpInDetlDao.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package thyyxxk.webserver.dao.his.medicine;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4. import com.baomidou.mybatisplus.core.toolkit.Constants;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import org.apache.ibatis.annotations.Select;
  8. import thyyxxk.webserver.entity.medicine.YpInDetlVo;
  9. import java.util.List;
  10. /**
  11. * @ClassName YpInDetlDao
  12. * @Author hsh
  13. * @Date 2025/6/30 0030 14:51
  14. * @Version 1.0
  15. * @Description 入库
  16. **/
  17. @Mapper
  18. public interface YpInDetlDao extends BaseMapper<YpInDetlVo> {
  19. @Select(" select convert(varchar(100), de.in_date, 20) as inDate, rtrim(de.in_docu_no) as inDocuNo, rtrim(de.rept_no) as reptNo, " +
  20. " de.confirm_flag, de.in_type, de.group_no, rtrim(de.charge_code) as chargeCode, de.serial, de.in_seri, de.buy_amt, de.buy_price, " +
  21. " convert(varchar(100), de.producing_date, 20) as producingDate, convert(varchar(100), de.eff_date, 23) as effDate, " +
  22. " rtrim(de.manu_no) as manuNo, de.manu_code, de.manufacture, de.supply_code, rtrim(de.license_no) as licenseNo, " +
  23. " de.acct_id, de.input_id, de.checker, de.purchaser, de.acct_type, de.stock_amount, de.rept_date, " +
  24. " rtrim(zd.name) as chargeName, rtrim(zd.specification) as specification, " +
  25. " rtrim(mi.name) as purchaserName, rtrim(sy.name) as supplyName, sy.supply_code as supplyId " +
  26. " from yp_in_detl as de " +
  27. " left join yp_zd_dict as zd on de.charge_code = zd.code and de.serial = zd.serial " +
  28. " left join a_employee_mi as mi on de.purchaser = mi.code " +
  29. " left join yp_zd_supply as sy on de.supply_code = sy.code " +
  30. " where ${ew.sqlSegment} " +
  31. " and de.confirm_flag = '1' and de.buy_amt > 0 " +
  32. " order by de.in_docu_no desc, de.in_seri ")
  33. List<YpInDetlVo> selectYpInDetlVoList(@Param(Constants.WRAPPER) QueryWrapper<?> qw);
  34. @Select(" select top 1 * from yp_in_detl where confirm_flag = '1' and buy_amt > 0 and rept_no = #{reptNo} and manu_no = #{manuNo} ")
  35. YpInDetlVo selectYpInDetlListByNo(@Param("reptNo") String reptNo, @Param("manuNo") String manuNo);
  36. @Select(" select convert(varchar(100), d.in_date, 20) as inDate, rtrim(d.in_docu_no) as inDocuNo, rtrim(d.rept_no) as reptNo, " +
  37. " d.confirm_flag, d.in_type, d.group_no, rtrim(d.charge_code) as chargeCode, d.serial, d.in_seri, d.buy_amt, d.buy_price, " +
  38. " convert(varchar(100), d.producing_date, 20) as producingDate, convert(varchar(100), d.eff_date, 23) as effDate, " +
  39. " rtrim(d.manu_no) as manuNo, d.manu_code, d.manufacture, d.supply_code, rtrim(d.license_no) as licenseNo, " +
  40. " d.acct_id, d.input_id, d.checker, d.purchaser, d.acct_type, d.stock_amount, d.rept_date, " +
  41. " rtrim(s.name) as chargeName, rtrim(s.specification) as specification, " +
  42. " rtrim(mi.name) as purchaserName, rtrim(sy.name) as supplyName, sy.supply_code as supplyId " +
  43. " from yp_in_detl as d " +
  44. " inner join yp_zd_dict as s on d.charge_code = s.code and d.serial = s.serial" +
  45. " left join a_employee_mi as mi on d.purchaser = mi.code " +
  46. " left join yp_zd_supply as sy on d.supply_code = sy.code " +
  47. " where d.confirm_flag = '1' " +
  48. " and d.buy_amt > 0 " +
  49. " and d.manu_no = #{manuNo} " +
  50. " and s.name like '%${drugName}%' " +
  51. " order by d.in_date desc ")
  52. List<YpInDetlVo> selectYpInDetlListByName(@Param("manuNo") String manuNo, @Param("drugName") String drugName);
  53. }