hjg
2024-03-18 8d48c59d5d3bcc4148ef97dc6f98e3a8cf9ca436
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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<Vehicle_XSTD> 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<Vehicle_XSTD> getlistbyVehicleId(String vehicleId);
    
    @Select("select * from fd_vehicle_xstd where companyNo=#{companyNo} ")
    public List<Vehicle_XSTD> getlistbycomNo(String companyNo);
    @Select("select * from fd_vehicle_xstd ")
    public List<Vehicle_XSTD> getlistAll();
    
//    @Select("select companyNo from fd_vehicle_xstd where vehicleId=#{vehicleId} group by companyNo ")
//    public List<String> getlistbyVehicleIdGp(String vehicleId); 
    
    @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and bsNo=#{bsNo} ")
    public List<Vehicle_XSTD> getlistbyVehicleIdandbsNoGp(@Param("vehicleId")String vehicleId,@Param("bsNo") String bsNo); 
    
    @Select("select * from fd_vehicle_xstd where vehicleId=#{vehicleId} and companyNo=#{companyNo} ")
    public List<Vehicle_XSTD> getlistbyVehandcompanyNo(@Param("vehicleId")String vehicleId,@Param("companyNo")String companyNo);
    
    @Select("select * from fd_vehicle_xstd where xstdNo=#{xstdNo} ")
    public List<Vehicle_XSTD> getlistbytdNo(String xstdNo);
    
    @Select("select * from fd_vehicle_xstd where xstdNo=#{xstdNo} and companyNo=#{companyNo} ")
    public List<Vehicle_XSTD> 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<Vehicle_XSTD> 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<Fd_Company> 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<Fd_Company> 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);
    
}