package com.mandi.fendan.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.mandi.fendan.persist.Fd_Company_Vehicle;

public interface Fd_ComVehicleMapper {
	
	@Select("select * from fd_company_vehicle where companyNo=#{companyNo} and vehicleId=#{vehicleId} and sdepartNo=#{sdepartNo} ")
	public Fd_Company_Vehicle getbyIDs(@Param("vehicleId") String vehicleId,@Param("companyNo")String companyNo,@Param("sdepartNo")String sdepartNo);
	
	@Insert("insert into fd_company_vehicle (companyNo,vehicleId,sdepartNo) values (#{companyNo},#{vehicleId},#{sdepartNo}) ")
	public int insertIDs(Fd_Company_Vehicle fdcv);
	
	@Delete("delete from fd_company_vehicle where companyNo=#{companyNo} and vehicleId=#{vehicleId} and sdepartNo=#{sdepartNo}  ")
	public int del(@Param("vehicleId")String vehicleId,@Param("companyNo")String companyNo,@Param("sdepartNo")String sdepartNo);
	@Delete("delete from fd_company_vehicle where vehicleId=#{vehicleId} and sdepartNo=#{sdepartNo} ")
	public int delbyID(@Param("vehicleId")String vehicleId,@Param("sdepartNo")String sdepartNo);
	@Delete("delete from fd_company_vehicle where companyNo!=#{companyNo} and vehicleId=#{vehicleId} and sdepartNo=#{sdepartNo} ")
	public int delIDandNoC(@Param("vehicleId")String vehicleId,@Param("companyNo")String companyNo,@Param("sdepartNo")String sdepartNo);
	
//	@Update("update fd_company_vehicle set vehicleId=#{nvehicleId} where vehicleId=#{ovehicleId}")
//	public int changeVehicle(@Param("nvehicleId")String nvehicleId,@Param("ovehicleId")String ovehicleId);
	
//	@Select("select * from fd_company_vehicle where vehicleId=#{vehicleId} ")
//	public List<Fd_Company_Vehicle> getbyVID(@Param("vehicleId") String vehicleId);
	
//	@Select("select a.vehicleId from fd_company_vehicle a LEFT JOIN fd_vehicle_xstd b on a.vehicleId=b.vehicleId where a.companyNo=#{companyNo} and b.xstdNo=#{xstdNo} GROUP BY a.vehicleId ")
//	public List<String> getbyVCNO(@Param("companyNo") String companyNo,@Param("xstdNo") String xstdNo);
	
	
}