package cn.stylefeng.guns.zjxl.dao;

import cn.stylefeng.guns.zjxl.model.ZjxlBasicInfo;
import cn.stylefeng.guns.zjxl.model.ZjxlPartner;
import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/***
 * @ClassName: ZjxlBasicInfoDao
 * @Description:
 * @Auther: shi kejing
 * @Date: 2020/11/3 15:52
 */
public interface ZjxlBasicInfoDao extends PagingAndSortingRepository<ZjxlBasicInfo,Long>, JpaSpecificationExecutor<ZjxlBasicInfo> {

    @Modifying
    @Query("update ZjxlBasicInfo a set a.basicInfoTel = ?2 where a.basicInfoId = ?1")
    int updatePartner(String id,String basicInfoTel);//修改，需要改什么就传什么

    @Modifying
    @Query("delete from ZjxlBasicInfo p where p.basicInfoId = ?1")
    int deleteById(String id);

}
