| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.safePlatform.equipment.entity.EquipmentInfo; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | |
| | | @Repository |
| | | public interface EquipmentInfoRepository extends BaseMapper<EquipmentInfo> { |
| | | |
| | | @Select("<script> select count(1) from equipment_info m INNER JOIN \n" + |
| | | "(select a.id,max(b.takecare_date) mdate from equipment_info a INNER JOIN equipment_takecare_detail b on a.id = b.equipment_id GROUP BY b.equipment_id) n \n" + |
| | | "on m.id = n.id where DATEDIFF(NOW(),n.mdate) >m.takecare_cycle</script> ") |
| | | Object countOverTime(); |
| | | } |