package com.brilliance.isc.mda.dao;

import com.brilliance.isc.bo.Wfe;
import com.brilliance.isc.model.wfe.WfeQueryCondition;
import com.brilliance.isc.vo.component.wfe.WfeInfo;
import com.brilliance.isc.vo.manager.WfeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;
import java.util.Map;

@Mapper
public interface WfeMapper {

    int insert(Wfe record);

    int insertSelective(Wfe record);

    int updateByPrimaryKeySelective(Wfe record);

    int updateByPrimaryKey(Wfe record);

    int deleteByPrimaryKey(Wfe record);

    int deleteByIds(Collection<Object> collection);

    Wfe selectByPrimaryKey(Wfe record);

    int dyncDelete(Map<String,Object> dyncMap);

    List<Wfe> dyncRead(Map<String,Object> dyncMap);

    Wfe getWfeByWfsinrAndSrv(@Param("wfsinr") String wfsinr, @Param("srv") String srv);

    int updateByVo(Wfe wfe);

    List<WfeVo> queryById(String inr);

    int update(WfeVo wfeVo);

    /**
     * 查询指定行数据
     *
     * @param wfeVo 查询条件
     * @return 对象列表
     */
    WfeVo queryByInr(WfeVo wfeVo);

    List<Wfe> selectByWfsinr(@Param("wfsinr") String wfsinr);

    List<Wfe> selectByTrninr(@Param("trninr") String trninr);

    List<Wfe> selectAllByTrninr(@Param("trninr") String trninr);

    List<Wfe> selectByTrninrAndSta(@Param("trninr") String trninr,@Param("sta") String sta);

    List<Wfe> selectByTrninrForRollback(@Param("trninr") String trninr);

    List<Wfe> selectByTrninrForRepair(@Param("trninr") String trninr);

    Wfe selectBySrvAndWfsinr(@Param("srv") String srv, @Param("trninr") String trninr);

    Wfe selectByWfssubAndWfsinr(@Param("wfssub") String wfssub, @Param("trninr") String trninr);

    Wfe gerWfeByWfsinrAndTrn(@Param("srv") String wfssub, @Param("ownref") String ownref,
                             @Param("inifrm") String inifrm, @Param("relflg") String relflg);

    int selectCountByTrninr(@Param("trninr") String trninr);

    int queryNoExecuteWithoutFin(@Param("wfsinr") String wfsinr);

    List<WfeInfo> queryByConditionList(WfeQueryCondition wfeQueryCondition);

    Wfe selectById(@Param("id") String id);

    int updateStaById(@Param("sta") String sta, @Param("id") String id);

    List<String> selectSrvByWfsinr(@Param("wfsinr") String wfsinr);

    int updateStaByWfsinrSrv(@Param("sta") String sta, @Param("wfsinr") String wfsinr,@Param("srv") String srv);

    int updateStaBySrvAndTrninr(@Param("sta") String sta, @Param("srv") String srv, @Param("trninr") String trninr);

    int updateStaByTrninr(@Param("sta") String sta,@Param("trninr") String trninr);

    Wfe selectWfeInfoByTrninrAndSrv(@Param("trninr")String trninr,@Param("srv")String srv);
}