智慧保安后台管理项目备份
Administrator
2021-07-22 887fe5cfaa835a8da3f6d7a6f48feeb8e52be88b
实时定位接口修改
6 files modified
228 ■■■■■ changed files
src/main/java/org/springblade/modules/location/entity/LiveLocation.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml 144 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/vo/LocusVo.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/entity/LiveLocation.java
@@ -60,4 +60,10 @@
     */
    private String latitude;
    /**
     * 实时位置地址
     */
    private String location;
}
src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.java
@@ -44,4 +44,32 @@
     * @return
     */
    LiveLocation getLiveLocationInfo(@Param("liveLocation") LiveLocation liveLocation);
    /**
     * 获取保安人员实时位置信息
     * @param liveLocationVo
     * @return
     */
    List<LiveLocationVo> getSecurityLocusInfoList(LiveLocationVo liveLocationVo);
    /**
     * 获取车辆实时位置信息
     * @param liveLocationVo
     * @return
     */
    List<LiveLocationVo> getCarLocusInfoList(LiveLocationVo liveLocationVo);
    /**
     * 获取枪支实时位置信息
     * @param liveLocationVo
     * @return
     */
    List<LiveLocationVo> getGunLocusInfoList(LiveLocationVo liveLocationVo);
    /**
     * 获取保安人员,车辆,枪支实时位置信息
     * @param liveLocationVo
     * @return
     */
    List<LiveLocationVo> selectSecurityAndCarAndGunLiveLocationPage(LiveLocationVo liveLocationVo);
}
src/main/java/org/springblade/modules/location/mapper/LiveLocationMapper.xml
@@ -76,6 +76,148 @@
            and sl.record_time &lt;= #{liveLocation.endTime}
        </if>
        order by sl.record_time desc
    </select>
    <!--保安人员的实时位置信息-->
    <select id="getSecurityLocusInfoList" resultType="org.springblade.modules.location.vo.LiveLocationVo">
        SELECT
            sll.*,
            bu.real_name name,bu.phone tel,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            blade_user bu
        on
            sll.worker_id = bu.id
        left join
            blade_dept bd
        on
            bu.dept_id = bd.id
        where
            sll.type=1
    </select>
    <!--车辆的实时位置信息-->
    <select id="getCarLocusInfoList" resultType="org.springblade.modules.location.vo.LiveLocationVo">
        SELECT
            sll.*,
            sc.car_number carNum,sc.person_in_charge linkman,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            sys_car sc
        on
            sll.worker_id = sc.id
        left join
            blade_dept bd
        on
            sc.dept_id = bd.id
        where
            sll.type=2
    </select>
    <!--枪支的实时位置信息-->
    <select id="getGunLocusInfoList" resultType="org.springblade.modules.location.vo.LiveLocationVo">
        SELECT
            sll.*,
            sg.gun_card_number number,sg.person_in_charge linkman,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            sys_gun sg
        on
            sll.worker_id = sg.id
        left join
            blade_dept bd
        on
            sg.dept_id = bd.id
        where
            sll.type=3
    </select>
    <!--枪支的实时位置信息-->
    <select id="selectSecurityAndCarAndGunLiveLocationPage" resultType="org.springblade.modules.location.vo.LiveLocationVo">
        (SELECT
            sll.*,
            bu.real_name name,
            null as number,
            null as linkman,
            null as carNum,
            bu.phone tel,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            blade_user bu
        on
            sll.worker_id = bu.id
        left join
            blade_dept bd
        on
            bu.dept_id = bd.id
        where
            sll.type=1)
        union all
        (SELECT
            sll.*,
            null as name,
            null as number,
            sc.person_in_charge linkman,
            sc.car_number carNum,
            null as tel,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            sys_car sc
        on
            sll.worker_id = sc.id
        left join
            blade_dept bd
        on
            sc.dept_id = bd.id
        where
            sll.type=2)
        union all
       (SELECT
            sll.*,
            null as name,
            sg.gun_card_number number,
            sg.person_in_charge linkman,
            null as carNum,
            null as tel,
            bd.dept_name company
        FROM
            sys_live_location sll
        left join
            sys_gun sg
        on
            sll.worker_id = sg.id
        left join
            blade_dept bd
        on
            sg.dept_id = bd.id
        where
            sll.type=3)
    </select>
</mapper>
src/main/java/org/springblade/modules/location/service/impl/LiveLocationServiceImpl.java
@@ -45,6 +45,7 @@
     */
    @Override
    public List<LocusVo> getLocusInfoList(LiveLocationVo liveLocationVo) {
        return baseMapper.getLocusInfoList(liveLocationVo);
    }
@@ -56,7 +57,21 @@
     */
    @Override
    public List<LiveLocationVo> getLiveLocationVoList(LiveLocationVo liveLocationVo) {
        return baseMapper.selectLiveLocationPage(null,liveLocationVo);
        if (null!=liveLocationVo.getType()){
            //保安人员
            if (liveLocationVo.getType()==1){
                return baseMapper.getSecurityLocusInfoList(liveLocationVo);
            }
            //车辆
            if (liveLocationVo.getType()==1){
                return baseMapper.getCarLocusInfoList(liveLocationVo);
            }
            //枪支
            if (liveLocationVo.getType()==1){
                return baseMapper.getGunLocusInfoList(liveLocationVo);
            }
        }
        return baseMapper.selectSecurityAndCarAndGunLiveLocationPage(liveLocationVo);
    }
    /**
src/main/java/org/springblade/modules/location/vo/LiveLocationVo.java
@@ -23,4 +23,35 @@
     */
    private String endTime;
    /**
     * 保安人员姓名
     */
    private String name;
    /**
     * 枪的型号
     */
    private String number;
    /**
     * 联系人
     */
    private String linkman;
    /**
     * 公司名称
     */
    private String company;
    /**
     * 联系电话
     */
    private String tel;
    /**
     * 车牌号
     */
    private String carNum;
}
src/main/java/org/springblade/modules/location/vo/LocusVo.java
@@ -11,4 +11,6 @@
@Data
public class LocusVo extends Locus implements Serializable {
}