提交 37ea005b authored 作者: zjm's avatar zjm

[添加了所有实体以及dao]

上级 087d632f
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.AccessControlName;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface AccessControlNameDao extends JpaRepository<AccessControlName,Integer>, JpaSpecificationExecutor<AccessControlName> {
AccessControlName findByDeviceNo(String deviceNo);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.AllotBackBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface AllotBackBillDao extends JpaRepository<AllotBackBill, Integer>, JpaSpecificationExecutor<AllotBackBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.AllotBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface AllotBillDao extends JpaRepository<AllotBill, Integer>, JpaSpecificationExecutor<AllotBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceApplyBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceApplyBillDao extends JpaRepository<DeviceApplyBill, Integer>, JpaSpecificationExecutor<DeviceApplyBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceChange;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceChangeDao extends JpaRepository<DeviceChange, Integer>, JpaSpecificationExecutor<DeviceChange> {
/**
* @param id 新装备Id
* 根据换新装备id查询装备更换记录
*/
DeviceChange findByNewDeviceId(Integer id);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceCheckBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceCheckBillDao extends JpaRepository<DeviceCheckBill, Integer>, JpaSpecificationExecutor<DeviceCheckBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceCheckDetail;
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 org.springframework.transaction.annotation.Transactional;
/**
* @author dengdiyi
*/
@SuppressWarnings("ALL")
@Transactional
public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, Integer>, JpaSpecificationExecutor<DeviceCheckDetail> {
/**
* 根据id更新checkDetail
*
* @param id detail id
* @param checkDetail 要更新的检查结果
*/
@Modifying
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6 where o.id=?1")
void updateCheckDetail(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount);
@Modifying
@Query("update DeviceCheckDetail o set o.checkStatus=?2 where o.id=?1")
int updateCheckStatus(int id, int checkStatus);
/**
* 更新 checkUserAId 与 checkUserBId
*
* @param id detailId
* @param checkUserAId 核查组成员A
* @param checkUserBId 核查组成员B
*/
@Modifying
@Query("update DeviceCheckDetail o set o.checkUserAId =?2,o.checkUserBId=?3 where o.id =?1")
void updateCheckUser(int id, int checkUserAId, int checkUserBId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceCheckPeriod;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* DeviceCheckPeriodDao.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/10/26 at 5:10 下午
*/
public interface DeviceCheckPeriodDao extends JpaRepository<DeviceCheckPeriod, Integer>, JpaSpecificationExecutor<DeviceCheckPeriod> {
/**
* @return 最新的一条周期数据
*/
DeviceCheckPeriod findTopByOrderByIdDesc();
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceCheckStat;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* DeviceCheckStatRepo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/8/16 at 5:26 下午
*/
public interface DeviceCheckStatDao extends JpaRepository<DeviceCheckStat, Integer> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceDestroyBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceDestroyBillDao extends JpaRepository<DeviceDestroyBill, Integer>, JpaSpecificationExecutor<DeviceDestroyBill> {
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@SuppressWarnings("SqlResolve")
public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>, JpaSpecificationExecutor<DeviceLibrary> {
List<DeviceLibrary> getAllByModel(String model);
List<DeviceLibrary> getAllByOwnUnit(String unit);
List<DeviceLibrary> getAllByTypeAndNameAndModel(Integer type, String name, String model);
/**
* 根据装备型号与装备所在地(多个地区)查询装备数量
*
* @param model 装备型号
* @param locations 装备所在地列表
* @return 装备数量
*/
int countByModelAndLocationUnitIn(String model, List<String> locations);
/**
* 根据装备型号与装备所在地(一个地区)查询装备数量
*
* @param model 装备型号
* @param location 装备所在地
* @return 装备数量
*/
int countByModelAndLocationUnit(String model, String location);
List<DeviceLibrary> getAllByPartParentIdAndIsPart(Integer parentId, Integer isPart);
List<DeviceLibrary> getAllByRfidCardId(String rfidCardId);
@Query(nativeQuery = true, value = "select * from device_library where id in :idList")
List<DeviceLibrary> getDeviceLibraryEntitiesByIdIn(@Param("idList") List<Integer> idList);
List<DeviceLibrary> getAllByRfidSurfaceId(String rfid);
@Query("select o from DeviceLibrary o where o.ownUnit= :unitName and o.createTime >= :startTime and o.createTime <= :endTime")
List<DeviceLibrary> findAllByUnitBetweenTime(String unitName, Date startTime, Date endTime);
List<DeviceLibrary> getAllByPackingId(Integer packingId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author dengdiyi
*/
public interface DeviceLogDao extends JpaRepository<DeviceLog, Integer>, JpaSpecificationExecutor<DeviceLog> {
/**
* @param deviceId 装备id
* @param type 0:装备日志,1:配套设备日志
* 通过装备id和日志类型查询装备履历
*/
List<DeviceLog> getAllByDeviceIdAndType(Integer deviceId, Integer type);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceRetiredBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author HuangXiahao
* @version V1.0
* @class DeviceRetiredBillDao
* @packageName com.tykj.dev.device.retired.subject.repository
**/
public interface DeviceRetiredBillDao extends JpaRepository<DeviceRetiredBill, Integer>, JpaSpecificationExecutor<DeviceRetiredBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.DeviceUseReport;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceUseReportDao extends JpaRepository<DeviceUseReport, Integer>, JpaSpecificationExecutor<DeviceUseReport> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.FinalDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
import java.util.Optional;
/**
* finalDetailRepo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/24 at 6:26 下午
*/
public interface FinalDetailDao extends JpaRepository<FinalDetail, Integer>, JpaSpecificationExecutor<FinalDetail> {
/**
* 根据reportId获得报告详情列表
*
* @param reportId 报告概览id
* @return 报告详情列表
*/
Optional<List<FinalDetail>> findByReportId(Integer reportId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.FinalReport;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* finalReportRepo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/24 at 6:27 下午
*/
public interface FinalReportDao extends JpaRepository<FinalReport, Integer>, JpaSpecificationExecutor<FinalReport> {
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.rfid.entity.domin.InputOutputDevice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author HuangXiahao
* @version V1.0
* @packageName com.tykj.dev.rfid.repository
**/
public interface InputOutputDeviceDao extends JpaRepository<InputOutputDevice, Integer>, JpaSpecificationExecutor<InputOutputDevice> {
List<InputOutputDevice> findAllByUnitIdAndDirection(Integer unitId,Integer direction);
List<InputOutputDevice> findAllByIsRead(Integer isRead);
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface LibraryWarningLogDao extends JpaRepository<LibraryWarningLog, Integer>, JpaSpecificationExecutor<LibraryWarningLog> {
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface LibraryWarningLogDetailDao extends JpaRepository<LibraryWarningLogDetail, Integer>, JpaSpecificationExecutor<LibraryWarningLogDetail> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.MatchingDeviceBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface MatchingDeviceBillDao extends JpaRepository<MatchingDeviceBill, Integer>, JpaSpecificationExecutor<MatchingDeviceBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.MatchingDeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface MatchingDeviceLibraryDao extends JpaRepository<MatchingDeviceLibrary, Integer>, JpaSpecificationExecutor<MatchingDeviceLibrary> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.MatchingRepairBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface MatchingRepairBillDao extends JpaRepository<MatchingRepairBill,Integer>, JpaSpecificationExecutor<MatchingRepairBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.PackingLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author dengdiyi
*/
public interface PackingLibraryDao extends JpaRepository<PackingLibrary, Integer>, JpaSpecificationExecutor<PackingLibrary> {
List<PackingLibrary> findAllByPartParentId(Integer id);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RepairBackBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceRepairBackBillDao.java
* @Description TODO
* @createTime 2020年08月25日 10:29:00
*/
public interface RepairBackBillDao extends JpaRepository<RepairBackBill, Integer>, JpaSpecificationExecutor<RepairBackBill> {
RepairBackBill findByDeviceRepairBillId(Integer repairBillId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RepairBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface RepairBillDao extends JpaRepository<RepairBill, Integer>, JpaSpecificationExecutor<RepairBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RepairDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
public interface RepairDetailDao extends JpaRepository<RepairDetail, Integer>, JpaSpecificationExecutor<RepairDetail> {
List<RepairDetail> findByDeviceRepairBillId(Integer billId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RepairSendBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface RepairSendBillDao extends JpaRepository<RepairSendBill, Integer>, JpaSpecificationExecutor<RepairSendBill> {
RepairSendBill findByDeviceRepairBillId(Integer id);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RfidChangeBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author HuangXiahao
* @version V1.0
* @packageName com.tykj.dev.rfid.repository
**/
public interface RfidChangeBillDao extends JpaRepository<RfidChangeBill, Integer>, JpaSpecificationExecutor<RfidChangeBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.RfidChangeLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author HuangXiahao
* @version V1.0
* @class RfidChangeLogDao
* @packageName com.tykj.dev.rfid.repository
**/
public interface RfidChangeLogDao extends JpaRepository<RfidChangeLog, Integer>, JpaSpecificationExecutor<RfidChangeLog> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.ScrapBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface ScrapBillDao extends JpaRepository<ScrapBill, Integer>, JpaSpecificationExecutor<ScrapBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.SelfCheckBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface SelfCheckBillDao extends JpaRepository<SelfCheckBill, Integer>, JpaSpecificationExecutor<SelfCheckBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.SendBackBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* <h4>Description : </h4>
*
* @Author czq
* @Date 2020-08-16 11:54
* @Version 1.0
*/
public interface SendBackBillDao extends JpaRepository<SendBackBill, Integer>, JpaSpecificationExecutor<SendBackBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.SendBackBillDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* <h4>Description : </h4>
*
* @Author czq
* @Date 2020-08-16 12:01
* @Version 1.0
*/
public interface SendBackBillDetailDao extends JpaRepository<SendBackBillDetail, Integer>, JpaSpecificationExecutor<SendBackBillDetail> {
SendBackBillDetail findSendBackBillDetailById(Integer id);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.StorageBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface StorageBillDao extends JpaRepository<StorageBill, Integer>, JpaSpecificationExecutor<StorageBill> {
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.Task;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
import java.util.Optional;
/**
* @author dengdiyi
*/
public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationExecutor<Task> {
/**
* @param billId 账单id
* @param businessType 业务类型
* 根据账单Id和业务类型查询task
*/
Optional<Task> findByBillIdAndBusinessType(Integer billId, Integer businessType);
/**
* 根据账单id、业务类型、任务状态查询task
*
* @param billId 账单id
* @param businessType 业务类型
* @param billStatus 任务状态
*/
List<Task> findAllByBillIdAndBusinessTypeAndBillStatus(Integer billId, Integer businessType, Integer billStatus);
/**
* 根据账单id、业务类型、任务状态查询task
*
* @param billId 账单id
* @param businessType 业务类型
*/
List<Task> findAllByBillIdAndBusinessType(Integer billId, Integer businessType);
/**
* 根据账单id、业务类型、以及父id为null
*
* @param billId 账单ID
* @param businessType 业务类型
*/
Task findAllByParentTaskIdIsNullAndBillIdAndBusinessType(Integer billId, Integer businessType);
List<Task> findAllByParentTaskId(Integer parentTaskId);
@Query("select o.billId from Task o where o.id=?1")
Integer findBillIdByTaskId(int taskId);
@Query("select o.billId from Task o where o.id=?1 and o.businessType=?2")
Integer findBillId(int id, int businessType);
@Query("select o.billId from Task o where o.parentTaskId = ?1 and o. businessType = ?2")
Integer findBillIdByParentId(int parentTaskId, int businessType);
List<Task> findTaskEntitiesByParentTaskId(Integer parentTaskId);
Task findByBusinessTypeAndOwnUnitAndBillStatus(Integer type, Integer ownUnit, Integer billStatus);
Task findByParentTaskIdAndAndTitle(Integer parentId, String title);
List<Task> findAllByBusinessType(Integer businessType);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.TaskLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author dengdiyi
*/
public interface TaskLogDao extends JpaRepository<TaskLog, Integer>, JpaSpecificationExecutor<TaskLog> {
/**
* @param taskId 业务id
* 通过业务id查询业务履历
*/
List<TaskLog> getAllByTaskId(Integer taskId);
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.device.train.entity.TrainTheme;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainDao.java
* @Description TODO
* @createTime 2020年08月13日 15:19:00
*/
public interface TrainThemeDao extends JpaRepository<TrainTheme, Integer>, JpaSpecificationExecutor<TrainTheme> {
List<TrainTheme> findAllByTrainStatus(Integer status);
}
package com.example.removetolocal.newentity.dao;
import com.tykj.dev.device.train.entity.TrainUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainUserDao.java
* @Description TODO
* @createTime 2020年12月01日 13:55:00
*/
public interface TrainUserDao extends JpaRepository<TrainUser, Integer>, JpaSpecificationExecutor<TrainUser> {
TrainUser findByUserIdAndTrainId(Integer userId,Integer trainId);
List<TrainUser> findAllByIsSignUpAndTrainId(Integer IsSignUp,Integer trainId);
List<TrainUser> findAllByTrainId(Integer trainId);
List<TrainUser> findAllByUnitsIdAndTrainId(Integer unitId,Integer userId);
}
package com.example.removetolocal.newentity.dao;
import com.example.removetolocal.newentity.WorkHandover;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zjm
* @version 1.0.0
* @ClassName WorkHandoverDao.java
* @Description 工作交接dao层
* @createTime 2020年09月17日 16:14:00
*/
public interface WorkHandoverDao extends JpaRepository<WorkHandover, Integer>, JpaSpecificationExecutor<WorkHandover> {
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论