package thyyxxk.webserver.dao.his.medicine;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.medicine.YpCodgLine;

import java.util.List;

@Mapper
public interface YpCodgLineDao extends BaseMapper<YpCodgLine> {

    @Delete("<script> " +
            " delete from yp_codg_line where sml_pac_trac_codg in " +
            " <foreach collection='list' item='item' open='(' separator=',' close=')'> " +
            " #{item.smlPacTracCodg} " +
            " </foreach> " +
            " </script>")
    int deleteYpCodgLineByIds(List<YpCodgLine> list);

    @Select(" select * from yp_codg_line where delv_bchno = #{reptNo} and manu_bchno = #{manuNo} and delventp_uscc = #{supplyId} ")
    List<YpCodgLine> selectYpCodgLineByCode(@Param("reptNo") String reptNo, @Param("manuNo") String manuNo, @Param("supplyId") String supplyId);


    @Select("<script> " +
            " select * from yp_codg_line where ref_flag = '0' and sml_pac_trac_codg in " +
            " <foreach collection='strArr' item='item' open='(' separator=',' close=')'> " +
            " #{item} " +
            " </foreach> " +
            " </script>")
    List<YpCodgLine> selectYpCodgLineByIds(List<String> strArr);

}
