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.persist.Fd_XSTDMX; import com.mandi.fendan.util.persist.WaitXSTDMX; public interface Fd_XSTDMXMapper { @Insert("insert into fd_xstdmx " + "(tdmx_tdfl,tdmx_tdls,tdmx_pch,tdmx_hj,tdmx_zt,tdmx_mz,tdmx_jz," + "tdmx_ggxh,tdmx_zpbz,tdmx_fdbz,tdmx_zcbz,tdmx_gbbz,tdmx_ck,tdmx_hth,tdmx_ywy,tdmx_ddh,tdmx_hwbh,tdmx_wlbh,tdmx_fhzz,tdmx_wbzcc,tdmx_cc) " //tdmx_ttlx + "values " + "(#{tdmx_tdfl},#{tdmx_tdls},#{tdmx_pch}," + "#{tdmx_hj},#{tdmx_zt},#{tdmx_mz},#{tdmx_jz},#{tdmx_ggxh},#{tdmx_zpbz}," + "0,0,0,#{tdmx_ck},#{tdmx_hth},#{tdmx_ywy},#{tdmx_ddh},#{tdmx_hwbh},#{tdmx_wlbh},#{tdmx_fhzz},#{tdmx_wbzcc},#{tdmx_cc})") //,#{tdmx_ttlx} public int insert(Fd_XSTDMX xstdmx); @Select("select * from fd_xstdmx where tdmx_tdfl=#{tdmx_tdfl} ") public Fd_XSTDMX get(String tdmx_tdfl); /** * 批量获取 * @param tdmx_tdfls * @return */ @Select("select * from fd_xstdmx where tdmx_tdfl in (${tdmx_tdfls}) ") public List gets(@Param("tdmx_tdfls") String tdmx_tdfls); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_gbbz=0 ") public List getListbytdls(String tdmx_tdls); /** * 根据提单分录和车牌号获取提单明细 * @param tdmx_tdls * @param tdmx_fdcph * @return */ @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_fdcph=#{tdmx_fdcph} and tdmx_gbbz=0 ") public List getListByTdlsAndCph(@Param("tdmx_tdls") String tdmx_tdls,@Param("tdmx_fdcph")String tdmx_fdcph); /**不要用了可能是两条记录,没有关闭标志**/ @Deprecated @Select("select * from fd_xstdmx where tdmx_pch=#{tdmx_pch} ") public Fd_XSTDMX getbyPCH(String tdmx_pch); /**改为 按照批次号和车牌号查找未关闭的明细**/ @Select("select top 1 a.* " + "from fd_xstdmx a LEFT JOIN fd_xstd b on a.tdmx_tdls=b.td_tdls " + "LEFT JOIN fd_vehicle_xstd c on b.td_tdbh=c.xstdNo " + "where a.tdmx_pch=#{tdmx_pch} and c.vehicleId=#{vehicleId} and tdmx_gbbz=0") public Fd_XSTDMX getbyPCHONE(@Param("tdmx_pch") String tdmx_pch,@Param("vehicleId") String vehicleId); /**改为 按照批次号和提单编号查找未关闭的明细**/ @Select("select top 1 a.* from fd_xstdmx a LEFT JOIN fd_xstd b on a.tdmx_tdls=b.td_tdls " + "where a.tdmx_pch=#{tdmx_pch} and b.td_tdbh=#{tdNo} and tdmx_gbbz=0 ") public Fd_XSTDMX getbyPCHandTDNOONE(@Param("tdmx_pch") String tdmx_pch,@Param("tdNo") String tdNo); @Delete("delete from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_zcbz=0 ") public int delbyTDLS(String tdmx_tdls); @Delete("delete from fd_xstdmx where tdmx_tdfl=#{tdmx_tdfl}") public int del(String tdmx_tdfl); @Update("update fd_xstdmx set tdmx_fdcph=#{tdmx_fdcph}," + "tdmx_fdbz=#{tdmx_fdbz},tdmx_fdywbh=#{tdmx_fdywbh},tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} where tdmx_tdfl=#{tdmx_tdfl}") public int updateFD(Fd_XSTDMX tdmx); @Update("update fd_xstdmx set tdmx_fdcph=#{tdmx_fdcph},tdmx_fdbz=#{tdmx_fdbz},tdmx_fdywbh=#{tdmx_fdywbh},tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} where tdmx_tdls=#{tdmx_tdls} and tdmx_gbbz=0 and tdmx_fdbz=0 and tdmx_zcbz=0 ") public int updateFDBatch(Fd_XSTDMX tdmx); @Update("update fd_xstdmx set tdmx_fdcph=null,tdmx_fdbz=0,tdmx_fdywbh=null,tdmx_fdwlgsbh=null where tdmx_tdls=#{tdmx_tdls} and tdmx_fdywbh=#{tdmx_fdywbh} and tdmx_gbbz=0 and tdmx_fdbz!=0 and tdmx_zcbz=0") public int cancelFDBatch(@Param("tdmx_tdls") String tdmx_tdls,@Param("tdmx_fdywbh") String tdmx_fdywbh); @Update("update fd_xstdmx set tdmx_zccph=#{tdmx_zccph},tdmx_zcbz=#{tdmx_zcbz}," + "tdmx_zcwlgsName=#{tdmx_zcwlgsName},tdmx_zcdriver=#{tdmx_zcdriver},tdmx_zcphone=#{tdmx_zcphone} " + "where tdmx_tdfl=#{tdmx_tdfl}") public int updateZC(Fd_XSTDMX tdmx); @Update("update fd_xstdmx set tdmx_zccph=#{tdmx_zccph},tdmx_zcbz=#{tdmx_zcbz}," + "tdmx_zcwlgsName=#{tdmx_zcwlgsName},tdmx_zcdriver=#{tdmx_zcdriver},tdmx_zcphone=#{tdmx_zcphone},tdmx_fdbz=0,tdmx_fdcph=null,tdmx_fdwlgsbh=null,tdmx_fdywbh=null " + "where tdmx_tdfl=#{tdmx_tdfl}") public int updateZCANDFD(Fd_XSTDMX tdmx); @Update({ "" }) public int updateZCnoFD(Fd_XSTDMX tdmx); @Update("update fd_xstdmx set tdmx_gbbz=#{tdmx_gbbz} where tdmx_tdfl=#{tdmx_tdfl}") public int updateGB(Fd_XSTDMX tdmx); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_gbbz=0 ") public List getbytdls(String tdmx_tdls); @Select("select * from fd_xstdmx where tdmx_tdfl=#{tdmx_tdfl} and tdmx_tdls=#{tdmx_tdls}") public Fd_XSTDMX getbytdflAndtdls(@Param("tdmx_tdfl") String tdmx_tdfl,@Param("tdmx_tdls") String tdmx_tdls); // @Select("select count(1) from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_gbbz=0 and (tdmx_fdbz!=0 or tdmx_zcbz!=0)") @Select("select count(1) from fd_xstdmx a LEFT JOIN fd_bsheet b on a.tdmx_fdywbh=b.bsNo where a.tdmx_tdls=#{tdmx_tdls} and a.tdmx_gbbz=0 and (a.tdmx_fdbz!=0 or a.tdmx_zcbz!=0) and b.status='在办' ") public int getbytdlswithZCorFD(String tdmx_tdls); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_gbbz=0 and tdmx_fdbz=0 and tdmx_zcbz=0 ") public List getNOZCandFD(String tdmx_tdls); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} and tdmx_fdywbh=#{tdmx_fdywbh} and tdmx_gbbz=0 and tdmx_fdbz=1 and tdmx_zcbz=0 ") public List getbyBsNoandcmNo(@Param("tdmx_tdls") String tdmx_tdls, @Param("tdmx_fdywbh") String tdmx_fdywbh,@Param("tdmx_fdwlgsbh") String tdmx_fdwlgsbh); @Update("update fd_xstdmx set tdmx_fdcph=null,tdmx_fdbz=0,tdmx_fdywbh=null,tdmx_fdwlgsbh=null where tdmx_tdls=#{tdmx_tdls} and tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} and tdmx_fdywbh=#{tdmx_fdywbh} and tdmx_gbbz=0 and tdmx_fdbz=1 and tdmx_zcbz=0 ") public int updatebyBsNoandcmNo(@Param("tdmx_tdls") String tdmx_tdls, @Param("tdmx_fdywbh") String tdmx_fdywbh,@Param("tdmx_fdwlgsbh") String tdmx_fdwlgsbh); @Select("select * from fd_xstdmx where tdmx_fdywbh=#{bsNo} and tdmx_gbbz=0 and tdmx_fdbz=1 and tdmx_zcbz=0 ") public List getbybsNoandNOZCandFD(String bsNo); @Update("update fd_xstdmx set tdmx_fdcph=null,tdmx_fdbz=0,tdmx_fdywbh=null,tdmx_fdwlgsbh=null where tdmx_fdywbh=#{bsNo} and tdmx_gbbz=0 and tdmx_fdbz=1 and tdmx_zcbz=0 ") public int updatebybsNoandNOZCandFD(String bsNo); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdmx_tdls} and tdmx_zcbz=0 ") public List getforClose(String tdmx_tdls); public List> getList(Map mp); public int countPage(Map mp); @Select("select * from fd_xstdmx where tdmx_tdls=#{tdls} and tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} and tdmx_gbbz=0 and tdmx_fdbz!=0 and tdmx_zcbz=0 ") public List getbytdlsandcmNo(@Param("tdls")String tdls,@Param("tdmx_fdwlgsbh")String tdmx_fdwlgsbh); @Update("update fd_xstdmx set tdmx_fdcph=null,tdmx_fdbz=0,tdmx_fdywbh=null,tdmx_fdwlgsbh=null where tdmx_tdls=#{tdls} and tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} and tdmx_gbbz=0 and tdmx_fdbz !=0 and tdmx_zcbz=0 ") public int updatebytdlsandcmNo(@Param("tdls")String tdls,@Param("tdmx_fdwlgsbh")String tdmx_fdwlgsbh); @Select("select count(1) from fd_xstdmx where tdmx_fdywbh=#{bsNo} and tdmx_tdls=#{tdls} and tdmx_zcbz=1 and tdmx_gbbz=0 and tdmx_zccph=#{vehicleId} ") public int getbyBsNowithZC(@Param("bsNo") String bsNo ,@Param("tdls") String tdls ,@Param("vehicleId") String vehicleId); @Select("select count(1) from fd_xstdmx where tdmx_fdywbh=#{bsNo} and tdmx_zcbz=1 and tdmx_gbbz=0 and tdmx_zccph=#{vehicleId}") public int getbyBsNowith(@Param("bsNo") String bsNo,@Param("vehicleId") String vehicleId); @Select("select * from xstdmx_view where tdmx_fdywbh=#{bsNo} and tdmx_fdwlgsbh=#{tdmx_fdwlgsbh} and tdmx_sfzc=0 ") public List getwaitMXbyBsNoandcmNo(@Param("bsNo")String bsNo,@Param("tdmx_fdwlgsbh")String tdmx_fdwlgsbh); @Select("select * from xstdmx_view where tdmx_fdywbh=#{bsNo} and tdmx_sfzc=0 ") public List getwaitMXbyBsNo(@Param("bsNo")String bsNo); @Select("select * from fd_xstdmx") public List getlistA(); @Update("update fd_xstdmx set tdmx_ggxh=#{tdmx_ggxh} where tdmx_tdfl=#{tdmx_tdfl}") public int updateMXGG(Fd_XSTDMX mx); //明晟 LED 装车 @Select({"select hw.name tdmx_hwmc,mx.* from fd_xstdmx mx " , " left join nc_hw hw on mx.tdmx_hwbh=hw.pkid and hw.state=1 " , " join xs_taskmonitor xt on mx.tdmx_fdywbh = xt.businessNo ", " join fd_bsheet on bsNo=tdmx_fdywbh and status='在办' " , " where SdepartNo=#{sdepartNo} and xt.firstgbtime is not null and xt.lastgbtime is null" }) public List getHwList(String sdepartNo); // 义瑞LED显示 序号 车号 装车区 状态 @Select({ "select bs.numberplates,businessNo,zcWz,firstzxhtime," , "case WHEN EXISTS ( SELECT * FROM bussinessitems WHERE bussinessNo = x.businessNo ) THEN '在装'" , " when x.firstgbtime is not null then '待装' else '完成' end zcStatus " , " from xs_taskmonitor x" , " join bussinesssheet bs on x.businessNo=bs.bussinessNo and bs.sstatus='在办' " , " where sdepartNo=#{sdepartNo} and firstgbtime is not null and x.lastgbtime is null " }) public List yRZcList(String sdepartNo); }