| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.entity.all.MenusAuthEntity; |
| | | import com.lf.server.entity.all.PermsAuthEntity; |
| | | import com.lf.server.entity.all.ResAuthEntity; |
| | | import com.lf.server.entity.bd.DlgagnpEntity; |
| | | import com.lf.server.entity.data.CoordEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.md.MdzxcgEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.bd.DlgagnpMapper; |
| | | import com.lf.server.service.data.MetaService; |
| | | import com.lf.server.service.data.UploadService; |
| | | import com.lf.server.service.show.LocateService; |
| | | import com.lf.server.service.sys.ArgsService; |
| | | import com.lf.server.service.sys.BlacklistService; |
| | | import com.lf.server.service.sys.ReportService; |
| | |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | ArgsService argsService; |
| | | |
| | | @Autowired |
| | | DlgagnpMapper dlgagnpMapper; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | LocateService locateService; |
| | | |
| | | @Autowired |
| | | Environment env; |
| | |
| | | mf.setExtName(".shp"); |
| | | |
| | | uploadService.loadSpatialData(mf); |
| | | } |
| | | |
| | | public void testBatchUpdate() { |
| | | DlgagnpEntity d1 = new DlgagnpEntity(); |
| | | d1.setGid(56); |
| | | d1.setGb("10"); |
| | | d1.setName("a01"); |
| | | DlgagnpEntity d2 = new DlgagnpEntity(); |
| | | d2.setGid(57); |
| | | d2.setGb("20"); |
| | | d2.setName("a02"); |
| | | |
| | | List<DlgagnpEntity> list = new ArrayList<>(); |
| | | list.add(d1); |
| | | list.add(d2); |
| | | |
| | | int rows = dlgagnpMapper.updateBatch(list); |
| | | } |
| | | |
| | | public void testMybatisPlus() { |
| | | String s1 = locateService.selectWktById(1); |
| | | |
| | | String tabName = BaseQueryService.getTabName(dlgagnpMapper); |
| | | List<String> list0 = dlgagnpMapper.selectFieldFuzzy(tabName, "name", "%县%"); |
| | | |
| | | DlgagnpEntity dlg = dlgagnpMapper.selectById(1); |
| | | String wkt = dlgagnpMapper.selectWktById(tabName, 2); |
| | | |
| | | Map<String, Object> map = new HashMap<String, Object>(3); |
| | | map.put("gid", 2); |
| | | List<DlgagnpEntity> list1 = dlgagnpMapper.selectByMap(map); |
| | | |
| | | QueryWrapper<DlgagnpEntity> w1 = new QueryWrapper<>(); |
| | | w1.eq("name", "治多县"); |
| | | List<DlgagnpEntity> list2 = dlgagnpMapper.selectList(w1); |
| | | |
| | | UpdateWrapper<DlgagnpEntity> w2 = new UpdateWrapper<DlgagnpEntity>(); |
| | | // 设置更新内容 |
| | | w2.set("name", "newName").set("gb", "10013") |
| | | // 设置更新条件 |
| | | .eq("gid", 0); |
| | | // dlgagnpMapper.update(null, w2) |
| | | |
| | | List<Integer> ids = new ArrayList<Integer>(); |
| | | ids.add(1); |
| | | ids.add(2); |
| | | // dlgagnpMapper.deleteBatchIds(ids) |
| | | List<DlgagnpEntity> list3 = dlgagnpMapper.selectBatchIds(ids); |
| | | |
| | | // dlgagnpMapper.updateById(dlg) |
| | | // List<DlgAgnp> all = dlgagnpMapper.selectList(null) |
| | | |
| | | // 页数 / 每页记录数 |
| | | Page<DlgagnpEntity> page = new Page<>(1, 10); |
| | | // 升序排序 |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | // 分页:Wrapper查询条件 |
| | | Page<DlgagnpEntity> userPage = dlgagnpMapper.selectPage(page, null); |
| | | // 总页数 / 总记录数:325 / 3247 |
| | | String str = userPage.getPages() + " / " + userPage.getTotal(); |
| | | List<DlgagnpEntity> list4 = userPage.getRecords(); |
| | | |
| | | QueryWrapper<DlgagnpEntity> w3 = new QueryWrapper<>(); |
| | | w3.like("name", "多").ge("gid", 100); |
| | | List<DlgagnpEntity> list5 = dlgagnpMapper.selectList(w3); |
| | | } |
| | | |
| | | public void testAes() { |
| | |
| | | } |
| | | |
| | | public void testReadExcel() { |
| | | List<?> listMdZxcg = ExcelHelper.readExcel(MdzxcgEntity.class, "D:\\LF\\data\\xls\\测绘\\1-项目成果-西三中\\1-1中线成果表\\海原县中线成果表.xlsx"); |
| | | List<?> listMdZxcg = ExcelHelper.readExcel(CoordEntity.class, "D:\\LF\\data\\xls\\测绘\\1-项目成果-西三中\\1-1中线成果表\\海原县中线成果表.xlsx"); |
| | | int r1 = listMdZxcg.size(); |
| | | |
| | | //List<MdGdcgEntity> listGdcg = ExcelHelper.readExcel(MdGdcgEntity.class, "D:\\LF\\data\\xls\\测绘\\2-地下管线探测成果\\2-2 管线成果表.xlsx"); |