|
@ -0,0 +1,26 @@
|
|
|
package com.yihu.jw.hospital.module.door.dao;
|
|
|
|
|
|
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by yeshijie on 2023/10/28.
|
|
|
*/
|
|
|
public interface ServiceItemPlanDao extends JpaRepository<ServiceItemPlanDO, String>, JpaSpecificationExecutor<ServiceItemPlanDO> {
|
|
|
|
|
|
@Query("from ServiceItemPlanDO w where w.signId =?1 ")
|
|
|
List<ServiceItemPlanDO> findBySignId(String signId);
|
|
|
|
|
|
@Query(value = "select * from base_service_item_plan w where w.sign_id =?1 and w.service_item_id=?2 order by w.plan_time desc", nativeQuery = true)
|
|
|
List<ServiceItemPlanDO> findBySignIdAndServiceItemId(String signId, String serviceItemId);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("UPDATE base_service_item_plan SET status='1' ,complete_time=?3 WHERE status='0' AND sign_id=?1 AND service_pack_id=?2 ORDER BY plan_time DESC LIMIT 1")
|
|
|
void updateState(String signId, String packageId, Date date);
|
|
|
}
|