Administrator
2022-12-12 5aa407dd55a0a8f37774308743bb0a593bd8da3c
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package com.mandi.fendan.mapper;
 
import java.util.List;
import java.util.Map;
 
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.util.persist.Serviceenum;
 
public interface BusinessMapper {
 
    /**
     * 存在发卡
     */
    @Select({" select top 1 * from bussinesssheet where exists( ",
            " select top 1 * from ACT_HI_TASKINST where NAME_ = 'issue_card' and PROC_INST_ID_ = instanceId and    (DELETE_REASON_ ='completed' or end_time_ is not null) " ,
            " ) and bussinessNo in(${bussinessNos}) "
    })
    public Map<String,Object> existsIssueCardByNos(@Param("bussinessNos") String bussinessNos);
 
    /**
     * 取销售在用卡
     * @param cardno
     * @param numberplates
     * @param sdepartNo
     * @return
     */
    @Select({"<script>" +
            "select top 1 bussinessNo from bussinesssheet " +
            "<where>",
            "cardno=#{cardno} and sstatus='在办' and numberplates = #{numberplates} " ,
            "<if test=\"sdepartNo!='' and sdepartNo!=null\">",
            " and sdepartNo=#{sdepartNo}",
            "</if>",
//            "and btid=3", //3为成品销售
            "</where>",
            " order by indx",
            "</script>" })
    public String getBusinessNoByCardNo(@Param("cardno") String cardno,@Param("numberplates") String numberplates,@Param("sdepartNo")String sdepartNo);
 
    @Deprecated
    @Select("select top 1 * 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> getbsbyBt(@Param("vehicleID") String vehicleID,@Param("btNo")String btNo,@Param("sstatus")Serviceenum sstatus,@Param("sdepartNo")String sdepartNo);
 
 
    /**
     * 分页获取已建的分单
     * @param mp
     * @return
     */
    public List<Map<String, Object>> getbslist(Map<String, Object> mp);
    public int getbspages(Map<String, Object> mp);
 
    @Deprecated
    @Select("select top 1 * from bussinesssheet where bussinessNo=#{bussinessNo}")
    public Map<String, Object> getBsheet(String bussinessNo);
 
    @Deprecated
    @Update("update bussinesssheet set invitecode=#{invitecode} where numberplates=#{vehicleID} and sstatus=#{sstatus} and sdepartNo=#{sdepartNo} ")
    public int updateMsg(@Param("invitecode") String invitecode,@Param("vehicleID") String vehicleID,@Param("sstatus") Serviceenum sstatus,@Param("sdepartNo") String sdepartNo);
    @Deprecated
    @Update("update bussinesssheet set sstatus=#{sstatus} where bussinessNo=#{bussinessNo} ")
    public int endBsheet(@Param("bussinessNo") String bussinessNo,@Param("sstatus") Serviceenum sstatus);
 
    @Deprecated
    @Select("select  top 1 * from bussinesssheet where invitecode=#{invitecode} and sstatus=#{sstatus} order by ctime desc")
    public Map<String, Object> getBsheetByInviteCodeNoSdNo(@Param("invitecode") String invitecode,@Param("sstatus")Serviceenum sstatus);
    @Deprecated
    @Insert("insert into bussinessitems "
    + "(id,bussinessNo,cdepart,cdepartid,cname,createid,ctime,fachang,factory,fcnum,loadbuild,materielNo,name,norms,note,num,reserved11,"
    + "reserved12,reserved13,reserved14,reserved15,reserved16,product_billNo,product_serialNo,product_otherNo,weight,price,preweight,hejin,pici,"
    + "gross,taotong,taotongWeight,money,product_ywrq,product_flh,unitname,recompany,reID,decompany,deID,frombatch,jsnum,rcompany,rID,forshowindx,barcode) values "
    + "(#{id},#{bussinessNo},#{cdepart},#{cdepartid},#{cname},#{createid},#{ctime},#{fachang},#{factory},#{fcnum},#{loadbuild},"
    + "#{materielNo},#{name},#{norms},#{note},#{num},#{reserved11},#{reserved12},#{reserved13},#{reserved14},#{reserved15},#{reserved16}"
    + ",#{product_billNo},#{product_serialNo},#{product_otherNo},#{weight},#{price},#{preweight},#{hejin},#{pici},#{gross},#{taotong},#{taotongWeight},"
    + "#{money},#{product_ywrq},#{product_flh},#{unitname},#{recompany},#{reID},#{decompany},#{deID},#{frombatch},#{jsnum},#{rcompany},#{rID},#{forshowindx},#{barcode})")
    public int insertBsi(Map<String, Object> wxst);
    @Deprecated
    @Insert("update bussinessitems set "
            + "bussinessNo=#{bussinessNo},cdepart=#{cdepart},cdepartid=#{cdepartid},cname=#{cname},createid=#{createid},ctime=#{ctime},"
            + "fachang=#{fachang},factory=#{factory},fcnum=#{fcnum},loadbuild=#{loadbuild},materielNo=#{materielNo},name=#{name},norms=#{norms},"
            + "note=#{note},num=#{num},reserved11=#{reserved11},"
            + "reserved12=#{reserved12},reserved13=#{reserved13},reserved14=#{reserved14},reserved15=#{reserved15},reserved16=#{reserved16},"
            + "product_billNo=#{product_billNo},product_serialNo=#{product_serialNo},"
            + "product_otherNo=#{product_otherNo},weight=#{weight},price=#{price},preweight=#{preweight},hejin=#{hejin},pici=#{pici},"
            + "gross=#{gross},taotong=#{taotong},taotongWeight=#{taotongWeight},money=#{money},product_ywrq=#{product_ywrq},product_flh=#{product_flh},"
            + "unitname=#{unitname},recompany=#{recompany},reID=#{reID},decompany=#{decompany},"
            + "deID=#{deID},frombatch=#{frombatch},jsnum=#{jsnum},rcompany=#{rcompany},rID=#{rID},forshowindx=#{forshowindx},barcode=#{barcode} where id=#{id} ")
    public int updateBsi(Map<String, Object> wxst);
    @Deprecated
    @Select("select * from bussinessitems where bussinessNo=#{bussinessNo} and pici=#{pici} ")
    public Map<String, Object> getbsi(@Param("pici")String pici,@Param("bussinessNo")String bussinessNo);
    @Deprecated
    @Select("select * from bussinessitems where bussinessNo=#{bussinessNo}")
    public List<Map<String, Object>> getbsibyNo(@Param("bussinessNo")String bussinessNo);
    @Deprecated
    @Delete("delete from bussinessitems where bussinessNo=#{bussinessNo} and barcode=#{barcode} ")
    public int delbysibyBarcode(@Param("barcode")String barcode,@Param("bussinessNo")String bussinessNo);
    @Deprecated
    @Delete("delete from bussinessitems where bussinessNo=#{bussinessNo} and pici=#{pici} ")
    public int delbypchandNo(@Param("pici")String pici,@Param("bussinessNo")String bussinessNo);
    @Deprecated
    @Delete("delete from bussinessitems where bussinessNo=#{bussinessNo}")
    public int delbydNo(@Param("bussinessNo")String bussinessNo);
    @Deprecated
    @Update("update bussinesssheet set driver=#{driver},phone=#{phone},numberplates=#{numberplates} where bussinessNo=#{bussinessNo}")
    public int changeVehicle(Map<String, Object> mp);
 
    @Select("SELECT count(1) from weight_doc where vehicleID=#{vehicleID} and businessNo=#{businessNo} and wdstate='正常' ")
    public int getweightDoc(@Param("vehicleID")String vehicleID,@Param("businessNo")String businessNo);
 
    @Select("SELECT count(1) from weight_doc where vehicleID=#{vehicleID} and businessNo=#{businessNo} and wdstate='正常' and gross>0 ")
    public int getgrosstDoc(@Param("vehicleID")String vehicleID,@Param("businessNo")String businessNo);
 
    @Update("update weight_doc set canfub=1 where vehicleID=#{vehicleID} and businessNo=#{businessNo} and wdstate='正常' and gross>0 ")
    public int updatecanFb(@Param("vehicleID")String vehicleID,@Param("businessNo")String businessNo);
 
 
    @Deprecated
    @Delete("delete from vehicle_queuing where numberplates=#{vehicleID}")
    public int delvehicleQ(@Param("vehicleID")String vehicleID);
    @Select("select count(1) from vehicle_queuing where numberplates=#{vehicleID}")
    public int getvehicleQ(@Param("vehicleID")String vehicleID);
 
    @Select("select top 1 ipadd from print_ipadd where addtype='分单打印地址' and state=1 ")
    public String getUsedbyAdd();
 
 
 
    @Update("update xs_taskmonitor set firstzxhtime=#{firstzxhtime},lastzxhtime=#{lastzxhtime} where businessNo=#{businessNo} ")
    public int updateTaskTime(Map<String, Object> xstm);
 
    @Select("select * from xs_taskmonitor where businessNo=#{businessNo} ")
    public Map<String, Object> selectTaskTime(String businessNo);
 
    @Update("update xs_taskmonitor set zcWc=#{zcWc},zcwcTime=#{zcwcTime} where businessNo=#{businessNo} ")
    public int updateZcWcTime(Map<String, Object> xstm);
 
    @Update("update xs_taskmonitor set canCm=#{canCm} where businessNo=#{businessNo} ")
    public int updateCanCm(Map<String, Object> xstm);
 
 
 
}