Newer
Older
huludao / src / main / java / com / newfiber / api / pc / dao / RiverManage / RiverPatrolDao.java
package com.newfiber.api.pc.dao.RiverManage;

import com.newfiber.api.core.base.BaseDao;
import com.newfiber.api.mobile.model.domain.InspectTheDistance;
import com.newfiber.api.mobile.model.domain.ProblemStatistical;
import com.newfiber.api.pc.model.River.RiverPatrol;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author wmj
 * @version 创建时间:2017/11/24
 * @description 河道巡查接口
 */
@Repository
public interface RiverPatrolDao extends BaseDao<RiverPatrol> {

    int addRiverPatrol(@Param("chiefUserNo") String chiefUserNo,
                       @Param("patrolTime") Date patrolTime,
                       @Param("patrolNo") String patrolNo);

    int updateRiverPatrol();

    int deleteRiverPatrol(@Param("patrolNo") String patrolNo);

    List<RiverPatrol> selectRiverPatrolList(@Param("pageNo") Integer pageNo,
                                            @Param("pageSize") Integer pageSize,
                                            @Param("patrolNo") String patrolNo,
                                            @Param("riverChiefNo") String riverChiefNo,
                                            @Param("riverName") String riverName);

    List<RiverPatrol> selectRiverPatrolListByWeiXin(@Param("riverNo") String riverNo,
                                                    @Param("createTime") Date createTime,
                                                    @Param("endTime") Date endTime,
                                                    @Param("page")Integer page,
                                                    @Param("rows")Integer rows);

    int countRiverPatrolList(@Param("patrolNo") String patrolNo,
                             @Param("riverChiefNo") String riverChiefNo,
                             @Param("riverName") String riverName);

    List<RiverPatrol> countRiverPatrolTotal(@Param("createTime") Date createTime,
                                            @Param("endTime") Date endTime);

    List<RiverPatrol> selectPatrolUserTotal(@Param("divisionNo") String divisionNo);
    
    List<RiverPatrol> selectPatrolByUserNo(@Param("list") List<String> list,
                                           @Param("pageNo") Integer pageNo,
                                           @Param("pageSize") Integer pageSize,
                                           @Param("sort") String sort,
                                           @Param("order") String order);
    
    int getPatrolCountByUserNo(List<String> list);
    
    List<String> getSubUserNo(String userNo);

    int selectRiverPatrolByRiverNo(@Param("riverNo") String riverNo,
                                   @Param("createTime") Date createTime,
                                   @Param("endTime") Date endTime);

    public List<RiverPatrol> getTourInfoByChiefNo(@Param("riverChiefNo")String riverChiefNo,
                                                  @Param("startTime")Date startTime,
                                                  @Param("endTime")Date endTime);

    /** 根据条件获取河长巡查表列表(无分页) */
    public List<RiverPatrol> queryListByDivisionNo(Map<String, Object> params);

    public List<RiverPatrol> queryCountByPatrolNo(@Param("patrolNo") String patrolNo);

    /**
     * @Description: 查询巡河详细信息
     * @param patrolNo 巡查编号
     * @return: com.newfiber.api.pc.model.River.RiverPatrol
     * @Author: Wmj
     * @Date: 2018/12/6 19:03
     */
    RiverPatrol queryInfoByPatrolNo(@Param("userNo") String userNo,@Param("patrolNo") String patrolNo);

    /**
     * 本级河长巡查次数统计
     * @param params 起止时间,当前用户sid
     * @return
     * @author chg
     * @date 2018-12-10
     */
    List<ProblemStatistical> pollingTimesCurrnt(Map<String,Object> params);

    /** 根据条件获取河长巡查表列表(分页) */
    public List<RiverPatrol> queryListByUserNo(Map<String, Object> params);

    /**
     * 查询当前用户下级区域所有用户巡查总距离
     * @param params 		起止时间 ,当前用户sid
     * @author chg
     * @date 2018-12-11
     */
    public List<InspectTheDistance> queryDistance(Map<String, Object> params);

    /**
     * 下级区域所有河长巡查次数统计
     * @param params 		起止时间,当前用户sid
     * @return
     * @author chg
     * @date 2018-12-10
     */
    public List<InspectTheDistance> pollingTimesSubordinate(Map<String,Object> params);

    /**
     * 下级区域应巡人数
     * @param params 		起止时间,当前用户sid
     * @return
     * @author chg
     * @date 2018-12-10
     */
    public List<ProblemStatistical> poollingUserNumSubordinate(Map<String,Object> params);

    /**
     * 获取指定区划每个河长的巡查次数
     * @param params 	区划编号
     * @return
     * @author chg
     * @date 2018-12-10
     */
    public List<InspectTheDistance> pollingTimesByDivisionNo(Map<String,Object> params);

    /**
     * 一个区域已巡检人数Map<String,Object> params
     * @param divisionNo 	区域编号
     * @param st 		 	起时间
     * @param et		 	止时间
     * @return
     */
    public int  inspected(@Param("divisionNo") String divisionNo,
            @Param("st")Date st,
            @Param("et")Date et);

    String queryOrgNoByRiverAndChiefNo(@Param("chiefUserNo") String chiefUserNo,
            @Param("riverNo") String riverNo);

    List<RiverPatrol> queryList(@Param("startRow") Integer startRow, @Param("pageSize")Integer pageSize,
                                @Param("userNo")String userNo,@Param("divisionNo")String divisionNo);

    public List<RiverPatrol> getAllChiefNo(@Param("startTime")Date startTime,@Param("endTime")Date endTime);

    List<RiverPatrol> selectAll(@Param("riverName") String riverName);

    String queryOrgNoByUserNo(@Param("chiefUserNo")String chiefUserNo);

    List<RiverPatrol> selectByRiverAndName(@Param("collect") List<String> collect,@Param("riverName") String riverName);
}