Administrator
2023-04-19 40ec16bbb7c9d23df625aa31ae42ac36e901749d
提交 | 用户 | 时间
58d006 1 package com.mandi.fendan.mapper;
A 2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Delete;
6 import org.apache.ibatis.annotations.Insert;
7 import org.apache.ibatis.annotations.Param;
8 import org.apache.ibatis.annotations.Select;
9 import org.apache.ibatis.annotations.Update;
10
11 import com.mandi.fendan.persist.Fd_Bsheet;
12 import com.mandi.fendan.persist.Fd_XSTD;
13 import com.mandi.fendan.util.persist.Serviceenum;
14 import com.mandi.fendan.util.persist.WaitXSTD;
15 import com.mandi.fendan.util.persist.WaitXSTDMX;
16 import com.mandi.fendan.util.persist.Yktbsitem;
17
18
19
20 public interface Fd_BsheetMapper {
21     @Select("select a.* from fd_bsheet a where a.id=#{id}")
22     public Fd_Bsheet get(String id);
23     @Select("select * from fd_bsheet where fdsheetNo=#{fdsheetNo} ")
24     public Fd_Bsheet getbyfdNo(String fdsheetNo);
25     @Select("select * from fd_bsheet where bsNo=#{bsNo} ")
26     public Fd_Bsheet getbybsNo(String bsNo);
27     @Select("select top 1 * from fd_bsheet where vehicleId=#{vehicleId} and sdepartNo=#{sdepartNo} and status='在办' ")
28     public Fd_Bsheet getbyVehicle(@Param("vehicleId")String vehicleId,@Param("sdepartNo")String sdepartNo);
29     @Select("select top 1 * from fd_bsheet where vehicleId=#{vehicleId} and sdepartNo!=#{sdepartNo} and status='在办' ")
30     public Fd_Bsheet getbyVehicleWithNoSdepartNo(@Param("vehicleId")String vehicleId,@Param("sdepartNo")String sdepartNo);
31
32     @Delete("delete  from fd_bsheet where id=#{id}")
33     public int del(String id);
34     @Delete("delete  from fd_bsheet where fdsheetNo=#{fdsheetNo}")
35     public int delbyfdNo(String fdsheetNo);
36     @Delete("delete  from fd_bsheet where bsNo=#{bsNo} ")
37     public int delbybsNo(String bsNo);
38     @Delete("delete from bussinessitems where pici=#{pici} and bussinessNo=#{bussinessNo}")
39     public int delbsitem(@Param("pici")String pici,@Param("bussinessNo") String bussinessNo);
40
41     @Update("update fd_bsheet set shdw=#{shdw} where id=#{id} ")
42     public int updateShdw(@Param("id") String id,@Param("shdw")String shdw);
43     @Update("update fd_bsheet set companyName=#{companyName},companyNo=#{companyNo},createName=#{createName},createid=#{createid},ctime=#{ctime},driver=#{driver},fdsheetNo=#{fdsheetNo},phone=#{phone},"
44             + "vehicleId=#{vehicleId},bsNo=#{bsNo},status=#{status},sendmsg=#{sendmsg},updateTime=#{updateTime} where id=#{id}")
45     public int update(Fd_Bsheet fd_bsheet);
46     @Update("update fd_bsheet set invitecode=#{invitecode},sendmsg=#{sendmsg} where id=#{id}")
47     public int updateInvitaCode(Fd_Bsheet fd_bsheet);
48     @Insert("insert into fd_bsheet(id,companyName,companyNo,createName,createid,ctime,driver,fdsheetNo,phone,"
49             + "vehicleId,bsNo,status,sendmsg,sdepartNo,updateTime) values (#{id},#{companyName},#{companyNo},#{createName},"
50             + "#{createid},#{ctime},#{driver},#{fdsheetNo},#{phone},upper(#{vehicleId}),#{bsNo},#{status},#{sendmsg},#{sdepartNo},#{updateTime})")
51     public int insert(Fd_Bsheet fd_bsheet);
52     @Insert("insert into fd_bsheet(id,companyName,companyNo,createName,createid,ctime,driver,fdsheetNo,phone,"
53             + "vehicleId,bsNo,status,sendmsg,sdepartNo,shdw,updateTime) values (#{id},#{companyName},#{companyNo},#{createName},"
54             + "#{createid},#{ctime},#{driver},#{fdsheetNo},#{phone},upper(#{vehicleId}),#{bsNo},#{status},#{sendmsg},#{sdepartNo},#{shdw},#{updateTime})")
55     public int insertAll(Fd_Bsheet fd_bsheet);
56     @Update("update fd_bsheet set status=#{status} where id=#{id}")
57     public int updateStatus(@Param("status")Serviceenum status,@Param("id")String id);
58     @Update("update fd_bsheet set sdepartNo=#{sdepartNo} where id=#{id} ")
59     public int updatesdepartNo(@Param("id") String id,@Param("sdepartNo")String sdepartNo);
60
61
62     @Select("select top 1  * from fd_bsheet where vehicleId=#{vehicleId} and status=#{status} and sdepartNo=#{sdepartNo} ")
63     public Fd_Bsheet getbyVehicleId(@Param("vehicleId") String vehicleId,@Param("status") Serviceenum status,@Param("sdepartNo")String sdepartNo);
64     @Select("select * from fd_bsheet where vehicleId=#{vehicleId} and status=#{status} ")
65     public List<Fd_Bsheet> getListbyVehicleId(@Param("vehicleId") String vehicleId,@Param("status") Serviceenum status);
66
67     @Select("select CASE WHEN a.td_fpbh IS NULL THEN a.BB WHEN a.td_fpbh='' THEN a.BB ELSE a.AA END td_khmc,"
68             + "a.td_khbh td_bmbh,a.id td_shdd from ( "
69             + "SELECT c.td_fpbh,c.td_khbh,d.id,"
70             + "CASE WHEN c.td_ywdybh= '101' THEN '河南报关' WHEN c.td_ywdybh= '102' THEN '郑州报关' WHEN c.td_ywdybh= '111' THEN '明晟报关' WHEN c.td_ywdybh= '114' THEN '义瑞报关' ELSE '科技报关' END AA,"
71             + "d.name BB from fd_bsheet a left JOIN fd_vehicle_xstd b on a.bsNo=b.bsNo and a.vehicleId=b.vehicleId "
72             + "left join fd_xstd c on b.xstdNo=c.td_tdbh "
73             + "LEFT JOIN company d on c.td_khbh=d.companyNo where a.bsNo=#{bsNo} and a.id=#{id} and b.fd_num>0 ) a ")
74     public List<WaitXSTD> getAllKH(@Param("bsNo") String bsNo,@Param("id") String id);
75 //    @Select("select a.* from fd_bsheet a LEFT JOIN cardinuse b on a.vehicleId=b.numberplates where a.sendmsg=0 "
76 //            + "and a.companyNo=#{companyNo} and a.status=#{status} "
77 //            + " and (b.cardno ='' or b.cardno is null )  and a.sdepartNo=#{sdepartNo} ")
78 //    public List<Fd_Bsheet> getSendMsglistbycNo(@Param("status")Serviceenum status,@Param("companyNo")String companyNo,@Param("sdepartNo")String sdepartNo);
79 //    @Select("select a.* from fd_bsheet a LEFT JOIN cardinuse b on a.vehicleId=b.numberplates where a.sendmsg=0 and a.createid=#{createid} and a.status=#{status}  and (b.cardno ='' or b.cardno is null ) ")
80 //    public List<Fd_Bsheet> getSendMsglistbycId(@Param("status")Serviceenum status,@Param("createid")String createid);
81
82
83     @Insert("insert into bussinessitems "
84     + "(id,bussinessNo,name,materielNo,norms,unitname,num,note,weight,price,preweight,pici,hejin,gross,taotong,taotongWeight,money,"
85     + "createid,cname,cdepartid,cdepart,ctime,loadbuild,factory,fachang,fcnum,product_billNo,product_serialNo,product_otherNo,"
86     + "product_ywrq,product_flh,reserved11,reserved12,reserved13,reserved14,reserved15,reserved16,recompany,reID,"
87     + "decompany,deID,rcompany,rID,frombatch,jsnum,forshowindx,barcode,nzwzfinish,product_thlx,"
88     + "product_thyy,product_thdq) values (#{id},#{bussinessNo},#{name},#{materielNo},#{norms},"
89     + "#{unitname},#{num},#{note},#{weight},#{price},#{preweight},#{pici},#{hejin},#{gross},"
90     + "#{taotong},#{taotongWeight},#{money},#{createid},#{cname},#{cdepartid},#{cdepart},"
91     + "#{ctime},#{loadbuild},#{factory},#{fachang},#{fcnum},#{product_billNo},#{product_serialNo},"
92     + "#{product_otherNo},#{product_ywrq},#{product_flh},#{reserved11},#{reserved12},#{reserved13},"
93     + "#{reserved14},#{reserved15},#{reserved16},#{recompany},#{reID},#{decompany},#{deID},#{rcompany},#{rID},"
94     + "#{frombatch},#{jsnum},#{forshowindx},#{barcode},#{nzwzfinish},#{product_thlx},#{product_thyy},#{product_thdq})")
95     public int insertbsitem( Yktbsitem bsitem);
96     @Select("select * from bussinessitems where pici=#{pici} and bussinessNo=#{bussinessNo}")
97     public Yktbsitem getbsitem(@Param("pici")String pici,@Param("bussinessNo") String bussinessNo);
98     @Select("select count(1) from bussinessitems where bussinessNo=#{bussinessNo}")
99     public int getbsitembyNo(@Param("bussinessNo") String bussinessNo);
100
101     @Select("select * from xstdmx_view where tdmx_tdls=#{tdmx_tdls} and tdmx_tdfl=#{tdmx_tdfl} ")
102     public WaitXSTDMX getWaittdmx(@Param("tdmx_tdls") String tdls,@Param("tdmx_tdfl") String tdfl);
103
104
105
106
107 }