Newer
Older
huludao / src / main / java / com / newfiber / api / pc / dao / EventsManage / AdministrativeDivisionDao.java
package com.newfiber.api.pc.dao.EventsManage;

import com.newfiber.api.core.base.BaseDao;
import com.newfiber.api.pc.model.EventsManage.AdministrativeDivision;
import com.newfiber.api.pc.model.EventsManage.AdministrativeDivisionQuery;
import com.newfiber.api.pc.model.EventsManage.Tree;
import com.newfiber.api.pc.model.River.RiverInfoBasis;
import com.newfiber.api.pc.model.Users;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Repository
public  interface AdministrativeDivisionDao extends BaseDao<AdministrativeDivision> {
    int countByExample(AdministrativeDivisionQuery example);

    int deleteByExample(AdministrativeDivisionQuery example);


    int insertSelective(AdministrativeDivision record);

    List<AdministrativeDivision> selectByExample(AdministrativeDivisionQuery example);
    //根据区划编号删除行政区划
    int deleteByDivisionNo(@Param("divisionNo") String divisionNo);

    List<AdministrativeDivision> selectByDivisionNo(@Param("divisionNo") String divisionNo);

    int updateByExampleSelective(@Param("record") AdministrativeDivision record, @Param("example") AdministrativeDivisionQuery example);

    //根据区划编号查询河流信息
    List<RiverInfoBasis> selectRiverByDivisionNo(@Param("divisionNo") String divisionNo);
    //查询父级区划
    AdministrativeDivision selectParentDivisionNo(@Param("divisionNo") String divisionNo);
    //按照父级编号查询下面的所有子级
    List<AdministrativeDivision> selectParentDivisionNoList(@Param("divisionNo") String divisionNo);

    //按照父级编号查询下面的所有子级
    List<AdministrativeDivision> selectuserNoListByDivisionNo(@Param("divisionNo") String divisionNo);

    //按照父级编号查询下面的所有子级以及统计各级河长数量
    List<AdministrativeDivision> selectCountRiverListByDivisionNo(@Param("divisionNo") String divisionNo);

    //按照父级编号统计下面的各级河长数量
    List<AdministrativeDivision> selectCountRiverByDivisionNo(@Param("list") List<String> list);

    String selectDivisionNo(@Param("userNo") String userNo);

    //根据区划编号查询相关机构的人员
    List<Users> getUserNoByDivisionNo(@Param("divisionNo") String divisionNo);

    //查询河流事件排行
    List<AdministrativeDivision> selectRiverEventCountOrder(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("list") List<String> riverList);

    //查询区域事件排行
    List<AdministrativeDivision> selectDivisionEventCountOrder(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("typeList") List<String> typeList, @Param("divisionList") List<String> divisionList);


    //按照父级编号查询下面的所有子级关联河道表
    List<AdministrativeDivision> selectParentDivisionNoListByRiver(@Param("divisionNo") String divisionNo);

    /**
     * 查询出本级以及下级所有的河流
     * @param districtNo
     * @return
     */
    List<RiverInfoBasis> selectRiveAndLowerRiver(@Param("list") List<String> districtNo, @Param("str") String str);

    /**
     * 获取本级区划列表
     * @param userNo 当前用户编号
     * @return
     */
    List<AdministrativeDivision> getCurrentDivision(@Param("userNo")String userNo);

    List<AdministrativeDivision> getSubordinateDivision(List<String> divisions);

    List<Tree> getDivisionTree(@Param("paraDivisionNo")String paraDivisionNo);

    List<AdministrativeDivision> getChildDivision();

    List<Tree> getDivisionTreeNew(@Param("paraDivisionNo")String paraDivisionNo);

    List<AdministrativeDivision> queryListByDivisionNo(@Param("divisionNo") String divisionNo);

    List<AdministrativeDivision> queryDivisionNoByUserNo(Map<String, Object> map);

    List<AdministrativeDivision> queryDivisionsubordinate(@Param("sid") String sid);

    List<AdministrativeDivision> listAll();

    List<AdministrativeDivision> listParent(@Param("parentNo")List<String> parentNo);

    List<AdministrativeDivision> queryListByDivisionNos(@Param("parentNo") List<String> divisionNo);

    List<AdministrativeDivision> listByDivisions(@Param("parentNo") List<String> divisionNo);

    List<AdministrativeDivision> nextDivision(@Param("divisionNos") List<String> divisionNos);

    List<AdministrativeDivision> selectAll();

    List<AdministrativeDivision> selectOne();
}