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; import com.mandi.fendan.persist.Vehicle_XSTD; public interface VehicleXSTDMapper { @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and xstdNo=#{xstdNo} and companyNo=#{companyNo} ") public Vehicle_XSTD getbyIDs(@Param("vehicleId") String vehicleId,@Param("xstdNo") String xstdNo,@Param("companyNo") String companyNo); @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and xstdNo=#{xstdNo} ") public List getbyIDsnocomNo(@Param("vehicleId") String vehicleId,@Param("xstdNo") String xstdNo); @Delete("delete from fd_vehicle_xstd where vehicleId=#{vehicleId} and xstdNo=#{xstdNo} and companyNo=#{companyNo} ") public int delbyIDs(@Param("vehicleId") String vehicleId,@Param("xstdNo") String xstdNo,@Param("companyNo") String companyNo); @Delete("delete from fd_vehicle_xstd where xstdNo=#{xstdNo} and companyNo=#{companyNo} ") public int delbyIDandcomNo(@Param("xstdNo") String xstdNo,@Param("companyNo") String companyNo); @Delete("delete from fd_vehicle_xstd where vehicleId=#{vehicleId} and bsNo=#{bsNo}") public int delbyVehicleId(@Param("vehicleId") String vehicleId,@Param("bsNo") String bsNo); // @Delete("delete from fd_vehicle_xstd where vehicleId=#{vehicleId} ") // public int delbyVehicleID(@Param("vehicleId") String vehicleId); @Insert("insert into fd_vehicle_xstd (vehicleId,xstdNo,fd_num,fd_weight,bsNo,companyNo) " + "values (upper(#{vehicleId}),#{xstdNo},#{fd_num},#{fd_weight},#{bsNo},#{companyNo}) ") public int insert(Vehicle_XSTD vxs); @Update("update fd_vehicle_xstd set fd_num=#{fd_num},fd_weight=#{fd_weight},bsNo=#{bsNo}" + " where vehicleId=#{vehicleId} and xstdNo=#{xstdNo} and companyNo=#{companyNo} ") public int updatewithIDs(Vehicle_XSTD vxs); // @Update("update fd_vehicle_xstd set vehicleId=#{nvehicleId} where vehicleId=#{vehicleId}") // public int changeVehicle(@Param("vehicleId")String vehicleId,@Param("nvehicleId")String nvehicleId); @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} ") public List getlistbyVehicleId(String vehicleId); @Select("select * from fd_vehicle_xstd where companyNo=#{companyNo} ") public List getlistbycomNo(String companyNo); @Select("select * from fd_vehicle_xstd ") public List getlistAll(); // @Select("select companyNo from fd_vehicle_xstd where vehicleId=#{vehicleId} group by companyNo ") // public List getlistbyVehicleIdGp(String vehicleId); @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and bsNo=#{bsNo} ") public List getlistbyVehicleIdandbsNoGp(@Param("vehicleId")String vehicleId,@Param("bsNo") String bsNo); @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and companyNo=#{companyNo} ") public List getlistbyVehandcompanyNo(@Param("vehicleId")String vehicleId,@Param("companyNo")String companyNo); @Select("select * from fd_vehicle_xstd where xstdNo=#{xstdNo} ") public List getlistbytdNo(String xstdNo); @Select("select * from fd_vehicle_xstd where xstdNo=#{xstdNo} and companyNo=#{companyNo} ") public List getbyxstdNoandcmNo(@Param("xstdNo")String xstdNo,@Param("companyNo")String companyNo); /** * 可以修改 * @param xstdNo * @param status * @return */ // @Select("select a.* from fd_vehicle_xstd a left join fd_vehicle b on a.vehicleId=b.vehicleId where a.xstdNo=#{xstdNo} and b.status=#{status} ") // public List getkxglist(@Param("xstdNo")String xstdNo,@Param("status")VehicleStatus status); @Select("select b.companyNo,max(b.name) name from fd_vehicle_xstd a left join fd_company b on a.companyNo=b.companyNo where a.vehicleId=#{vehicleId} GROUP BY b.companyNo ") public List getCompany(@Param("vehicleId") String vehicleId,@Param("bsNo") String bsNo); @Select("select b.companyNo,max(b.name) name ,a.bsNo note from fd_vehicle_xstd a left join fd_company b on a.companyNo=b.companyNo GROUP BY b.companyNo,a.bsNo ") public List getAllCom(); @Select("select top 1 a.* from fd_vehicle_xstd a where a.vehicleId=#{vehicleId} and a.xstdNo=#{xstdNo} ") public Vehicle_XSTD getVhicleByIDs(@Param("vehicleId") String vehicleId,@Param("xstdNo") String xstdNo); }