package cn.estsh.i3plus.core.apiservice.dao;

/**
 * @Description : hql申明查询demo
 * 继承了crudrepository，包含了常用hql方法
 * @Reference : 如果需要执行原生sql，则添加 @Query(sql,nativeQuery=true)
 * @Author : alwaysfrin
 * @CreateDate : 2018-09-05 16:41
 * @Modify:
 **/
//@Repository
//public interface IMachineFactoryDao extends CrudRepository<MachineFactory,Long> {

    //此处findBy开头，会自动根据属性名进行查询
    /*List<MachineFactory> findByFactoryName(String factoryName);

    @Modifying
    @Query("update MachineFactory mf set mf.factoryName = :factoryName where mf.id = :id")
    void updateMachineFactoryNameById(long id, String factoryName);

    @Modifying
    @Query("delete from MachineFactory mf where id = :id")
    void deleteMachineFactoryById(@Param("id") long id);

    //按位查询
    @Query("select mf from MachineFactory mf where factoryName = ?1")
    List<MachineFactory> findMachineFactoryByFactoryName(String factoryName);

    //参数匹配
    @Query("from MachineFactory mf where mf.factoryCode = :factoryCode")
    List<MachineFactory> findMachineFactoryByFactoryCode(@Param("factoryCode") String factoryCode);

    //自定义Hql
    @Query("from MachineFactory mf where mf.createDatetime like '2018-01-01%'")
    List<MachineFactory> findMachineFactorySpecial();*/
//}
