hjg
2023-10-08 a966b5abe5fb804464fe1cd09053a03fe94877fd
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
package com.mandi.fendan.mapper;
 
import java.util.List;
import java.util.Map;
 
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
 
import com.mandi.fendan.util.persist.Serviceenum;
 
/**
 * 一卡通数据取值
 * @author 15083
 *
 */
public interface Fd_YKTMapper {
    
    @Select("select a.* from enterworker a left join users b on a.userid=b.id where b.username=#{username}")
    public Map<String, Object> findWorkerByUserName(String username);
    @Update("update bussinesssheet set canedit='不可编辑',sstatus='终止' where bussinessNo=#{bussinessNo} ")
    public int endBsheet(String bussinessNo);
    @Delete("delete from bussinesssheet  where bussinessNo=#{bussinessNo} ")
    public int delBsheet(String bussinessNo);
    @Select("select * from cardinuse where cardno=#{cardno} ")
    public Map<String, Object> getcardinuse(String cardno);
    @Select("select * from vehicle_queuing where numberplates=#{vehicleId} and gatesNo=#{gatesNo} ")
    public Map<String, Object> getpdindx(@Param("vehicleId") String vehicleId,@Param("gatesNo") String gatesNo);
    @Select("select top 1 a.* from bussinesssheet a left join gbusi_type b  on a.btid=b.id where b.businesstypeNo=#{btNo} and a.numberplates=#{vehicleID} and a.sstatus=#{sstatus} and a.sdepartNo=#{sdepartNo} ")
    public Map<String, Object> getBsheet(@Param("vehicleID") String vehicleID,@Param("btNo") String btNo,@Param("sstatus") Serviceenum status,@Param("sdepartNo") String sdepartNo);
    @Select("select top 1 * from cardinuse where numberplates=#{vehicleId}")
    public Map<String, Object> getcardbyVehicleID(String vehicleId);
    @Update("update bussinesssheet set rcompany=#{shcompany},rcID=#{rcID} where bussinessNo=#{bussinessNo} ")
    public int updateshcompany(@Param("bussinessNo")String bussinessNo,@Param("shcompany") String shcompany,@Param("rcID") String rcID);
    
    @Select("select count(1) from weight_doc where businessNo=#{bussinessNo} and wdstate='正常' ")
    public int getweight_doc(@Param("bussinessNo")String bussinessNo);
    
    @Select("SELECT ISNULL(SUM(a.gross),0) gross,ISNULL(SUM(a.tare),0) tare from weight_doc a where a.businessNo=#{bussinessNo} and a.wdstate='正常'  ")
    public Map<String, Object> getweight_docgt(@Param("bussinessNo")String bussinessNo);
    
    @Select("SELECT DISTINCT(b.username) FROM worker_depart a LEFT JOIN users b on a.userid=b.id LEFT JOIN enterworker e on a.workerNo=e.gonghao where a.departNo=#{bianhao} and e.state=1 and b.id is not null  ")
    public List<String> getUserNsByDepart(String bianhao);
    
    
}