| | |
| | | @TableField("securityArr") |
| | | private String securityArr; |
| | | |
| | | /** |
| | | * 巡逻路线 |
| | | */ |
| | | private String xllx; |
| | | |
| | | |
| | | } |
| | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2020-07-15 |
| | |
| | | public R<IPage<RouteinVO>> list(Routein routein, Query query) { |
| | | IPage<Routein> pages = routeinService.page(Condition.getPage(query), Condition.getQueryWrapper(routein)); |
| | | return R.data(RouteinWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/tree") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入routein") |
| | | public R<List<RouteinVO>> tree(Routein routein, Query query) { |
| | | List<RouteinVO> tree = routeinService.tree(); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * 巡逻路线新增 |
| | | * |
| | | * @param routeName |
| | | * @param regionId |
| | | * @param routeInfo |
| | |
| | | public R insertlx(String routeName, String regionId, String routeInfo, String creatName, String remarks, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | Routein routein = new Routein(); |
| | | String a="'LINESTRING("+routeInfo+")'"; |
| | | String a = "'LINESTRING(" + routeInfo + ")'"; |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String time = df.format(new Date()); |
| | | routein.setRouteName(routeName); |
| | |
| | | |
| | | /** |
| | | * 修改巡逻路线 |
| | | * |
| | | * @param id |
| | | * @param routeName |
| | | * @param regionId |
| | |
| | | public R updatelx(Integer id, String routeName, String regionId, String routeInfo, String creatName, String remarks, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | String a="'LINESTRING("+routeInfo+")'"; |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | String a = "'LINESTRING(" + routeInfo + ")'"; |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String time = df.format(new Date()); |
| | | routeinService.updatelx(id,routeName,regionId,a,time,creatName,remarks); |
| | | routeinService.updatelx(id, routeName, regionId, a, time, creatName, remarks); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 巡逻路线查询 |
| | | * @param routeName 路线名称 |
| | | * |
| | | * @param routeName 路线名称 |
| | | * @param response |
| | | * @return |
| | | */ |
| | |
| | | public R selectList(String routeName, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | return R.data(routeinService.selectList(routeName)); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<RouteinVO> selectRouteinPage(IPage page, RouteinVO routein); |
| | | List<RouteinVO> tree(); |
| | | void insertlx(Routein routein); |
| | | void updatelx(Integer id, String routeName, String regionId, String a, String rTime, String creatName, String remarks); |
| | | List<RouteinVO> selectList(String routeName); |
| | |
| | | <result column="remarks" property="remarks"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode"> |
| | | <id column="id" property="id"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | <result column="title" property="title"/> |
| | | <result column="value" property="value"/> |
| | | <result column="key" property="key"/> |
| | | <result column="has_children" property="hasChildren"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectRouteinPage" resultMap="routeinResultMap"> |
| | | select * from sys_routein where is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="tree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | id, |
| | | 0 AS parent_id, |
| | | routeName AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | sys_routein |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertlx" useGeneratedKeys="true" keyProperty="id" parameterType="org.springblade.modules.routeIn.entity.Routein"> |
| | | INSERT INTO sys_routein (routeName,regionId,routeInfo,rTime,creatName,remarks) VALUES (#{routeName},#{regionId},ST_GeomFromText(${routeInfo}),#{rTime},#{creatName},#{remarks}); |
| | |
| | | * @return |
| | | */ |
| | | IPage<RouteinVO> selectRouteinPage(IPage<RouteinVO> page, RouteinVO routein); |
| | | List<RouteinVO> tree(); |
| | | void insertlx(Routein routein); |
| | | void updatelx(Integer id, String routeName, String regionId, String a, String rTime, String creatName, String remarks); |
| | | List<RouteinVO> selectList(String routeName); |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.modules.routeIn.entity.Routein; |
| | | import org.springblade.modules.routeIn.mapper.RouteinMapper; |
| | | import org.springblade.modules.routeIn.service.IRouteinService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<RouteinVO> tree() { |
| | | return baseMapper.tree(); |
| | | } |
| | | |
| | | @Override |
| | | public void insertlx(Routein routein) { |
| | | baseMapper.insertlx(routein); |
| | | } |
| | |
| | | |
| | | private String work_status; |
| | | |
| | | private String examination_type; |
| | | |
| | | private String examination_mx; |
| | | |
| | | } |
| | |
| | | <result column="post_id" property="postId"/> |
| | | <result column="online_status" property="online_status"/> |
| | | <result column="work_status" property="work_status"/> |
| | | <result column="examination_type" property="examination_type"/> |
| | | <result column="examination_mx" property="examination_mx"/> |
| | | </resultMap> |
| | | <resultMap id="userResultMaps" type="org.springblade.modules.system.vo.UsersVo"> |
| | | <result column="id" property="id"/> |
| | |
| | | <result column="work_status" property="work_status"/> |
| | | <result column="jd" property="jd"/> |
| | | <result column="wd" property="wd"/> |
| | | <result column="examination_type" property="examination_type"/> |
| | | <result column="examination_mx" property="examination_mx"/> |
| | | <result column="dept_name" property="deptName"/> |
| | | </resultMap> |
| | | |
| | |
| | | select s.*,p.jd,p.wd,ST_ASTEXT ( e.coordinate ) from blade_user s |
| | | LEFT JOIN sys_position p ON p.snumber = s.CODE |
| | | LEFT JOIN sys_enclosure e ON e.anumber = s.CODE |
| | | |
| | | where s.is_deleted = 0 |
| | | left join |
| | | blade_role br |
| | | on |
| | | s.role_id=br.id |
| | | where s.is_deleted = 0 and br.role_alias ='处警员' |
| | | <if test="user.account!=null and user.account != ''"> |
| | | and s.account = #{user.account} |
| | | </if> |
| | |
| | | <if test="user.userType!=null and user.userType != ''"> |
| | | and s.user_type = #{user.userType} |
| | | </if> |
| | | <if test="user.examination_type!=null and user.examination_type != ''"> |
| | | and s.examination_type = #{user.examination_type} |
| | | </if> |
| | | <if test="deptIdList!=null and deptIdList.size>0"> |
| | | and s.id in ( |
| | | SELECT |
| | |
| | | |
| | | @Override |
| | | public IPage<User> selectUserPages(IPage<User> page, User user, String deptId) { |
| | | if (deptId != null){ |
| | | if (deptId != null && !deptId.equals("")){ |
| | | String arr =deptId.toString(); |
| | | List<String> array = Arrays.asList(arr.split(",")); |
| | | return page.setRecords(baseMapper.selectUserPages(page, user, array)); |