Merge remote-tracking branch 'origin/zhangjunhe'

This commit is contained in:
wangliwen 2022-05-26 19:43:56 +08:00
commit 7f7fadbafc
38 changed files with 13535 additions and 3 deletions

View File

@ -219,6 +219,10 @@
<artifactId>pinyin4j</artifactId>
<version>${pinyin4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -5,6 +5,7 @@ import io.renren.common.interceptor.DataFilterInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* mybatis-plus配置
@ -12,6 +13,7 @@ import org.springframework.core.annotation.Order;
* @since 1.0.0
*/
@Configuration
@EnableScheduling
public class MybatisPlusConfig {
/**
@ -32,4 +34,15 @@ public class MybatisPlusConfig {
return new PaginationInterceptor();
}
// @Bean
// @Order(0)
// public MybatisPlusInterceptor mybatisPlusInterceptor(){
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// //添加分页插件
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// //添加乐观锁插件
// interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
// return interceptor;
// }
}

View File

@ -1,4 +1,5 @@
package io.renren.modules.ability.dao.ai;
import org.apache.ibatis.annotations.Param;
import io.renren.common.dao.BaseDao;
import io.renren.modules.ability.entity.ai.BsAbilityAiEntity;

View File

@ -23,7 +23,6 @@ import java.util.Map;
/**
* 任务管理
*
* @author Jone
*/
@RestController
@ -151,7 +150,7 @@ public class ActTaskController {
if (StringUtils.isEmpty(taskDTO.getTaskId())) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.completeTaskByVariables(taskDTO);
//actTaskService.completeTaskByVariables(taskDTO);
return new Result();
}

View File

@ -0,0 +1,116 @@
package io.renren.modules.eventListTest.controller;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.eventListTest.dto.EventListControllerDTO;
import io.renren.modules.eventListTest.excel.EventListControllerExcel;
import io.renren.modules.eventListTest.service.EventListControllerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@RestController
@RequestMapping("EventListTest/eventlistcontroller")
@Api(tags="商汤算法列表查询")
public class EventListController {
@Autowired
private EventListControllerService eventListControllerService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("EventListTest:eventlistcontroller:page")
public Result<PageData<EventListControllerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<EventListControllerDTO> page = eventListControllerService.page(params);
return new Result<PageData<EventListControllerDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("EventListTest:eventlistcontroller:info")
public Result<EventListControllerDTO> get(@PathVariable("id") Long id){
EventListControllerDTO data = eventListControllerService.get(id);
return new Result<EventListControllerDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("EventListTest:eventlistcontroller:save")
public Result save(@RequestBody EventListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
eventListControllerService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("EventListTest:eventlistcontroller:update")
public Result update(@RequestBody EventListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
eventListControllerService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("EventListTest:eventlistcontroller:delete")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
eventListControllerService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("EventListTest:eventlistcontroller:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EventListControllerDTO> list = eventListControllerService.list(params);
ExcelUtils.exportExcelToTarget(response, null, "test", list, EventListControllerExcel.class);
}
}

View File

@ -0,0 +1,16 @@
package io.renren.modules.eventListTest.dao;
import io.renren.common.dao.BaseDao;
import io.renren.modules.eventListTest.entity.EventListControllerEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Mapper
public interface EventListControllerDao extends BaseDao<EventListControllerEntity> {
}

View File

@ -0,0 +1,25 @@
package io.renren.modules.eventListTest.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ApiModel(value = "test")
public class EventListControllerDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String eventType;
private String eventCnName;
private String eventDesc;
}

View File

@ -0,0 +1,24 @@
package io.renren.modules.eventListTest.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("tb_event_list")
public class EventListControllerEntity {
private static final long serialVersionUID = 1L;
@TableId
private Integer id;
private String eventType;
private String eventCnName;
private String eventDesc;
}

View File

@ -0,0 +1,28 @@
package io.renren.modules.eventListTest.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ContentRowHeight(20)
@HeadRowHeight(20)
@ColumnWidth(25)
public class EventListControllerExcel {
@ExcelProperty(value = "Integer", index = 0)
private Integer id;
@ExcelProperty(value = "String", index = 1)
private String eventType;
@ExcelProperty(value = "String", index = 2)
private String eventCnName;
@ExcelProperty(value = "String", index = 3)
private String eventDesc;
}

View File

@ -0,0 +1,17 @@
package io.renren.modules.eventListTest.service;
import io.renren.common.service.CrudService;
import io.renren.modules.eventListTest.dto.EventListControllerDTO;
import io.renren.modules.eventListTest.entity.EventListControllerEntity;
import io.renren.modules.eventListTest.dto.EventListControllerDTO;
import io.renren.modules.eventListTest.entity.EventListControllerEntity;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
public interface EventListControllerService extends CrudService<EventListControllerEntity, EventListControllerDTO> {
}

View File

@ -0,0 +1,35 @@
package io.renren.modules.eventListTest.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.constant.Constant;
import io.renren.modules.eventListTest.dao.EventListControllerDao;
import io.renren.modules.eventListTest.dto.EventListControllerDTO;
import io.renren.modules.eventListTest.entity.EventListControllerEntity;
import io.renren.modules.eventListTest.service.EventListControllerService;
import io.renren.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Service
public class EventListControllerServiceImpl extends CrudServiceImpl<EventListControllerDao, EventListControllerEntity, EventListControllerDTO> implements EventListControllerService {
@Override
public QueryWrapper<EventListControllerEntity> getWrapper(Map<String, Object> params){
QueryWrapper<EventListControllerEntity> wrapper = new QueryWrapper<>();
return wrapper;
}
}

View File

@ -105,7 +105,9 @@ public class ResourceController {
@ApiOperation("查询热门能力")
@LogOperation("查询热门能力")
public Result selectMostPopular(@RequestBody JSONObject jsonObject) {
return new Result<>().ok(resourceService.selectMostPopular(jsonObject));
}
@GetMapping("/selectRecommend")

View File

@ -1,10 +1,13 @@
package io.renren.modules.resource.dao;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.common.dao.BaseDao;
import io.renren.modules.resource.entity.AttrEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.sql.SQLOutput;
import java.util.List;
/**
@ -17,5 +20,5 @@ import java.util.List;
public interface AttrDao extends BaseDao<AttrEntity> {
Integer delete4Resource(@Param("resourceIds") List<Long> idList);
}

View File

@ -61,6 +61,7 @@ public class ShiroConfig {
filterMap.put("/druid/**", "anon");
filterMap.put("/login", "anon");
filterMap.put("/swagger/**", "anon");
filterMap.put("/STapi/project/receiveSubscribe", "anon");
filterMap.put("/v2/api-docs", "anon");
filterMap.put("/doc.html", "anon");
filterMap.put("/swagger-resources/**", "anon");

View File

@ -0,0 +1,102 @@
package io.renren.modules.taskList.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.renren.modules.taskList.dao.TaskListControllerDao;
import io.renren.modules.taskList.entity.TaskListControllerEntity;
import io.renren.modules.taskList.service.ShangTangService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("STapi/project")
@Api(tags = "事件")
@Log4j2
public class ShangTangController {
@Resource
private ShangTangService shangTangService;
@Resource
private TaskListControllerDao taskListControllerDao;
/**
* 事件模板分页查询接口
* @return
*/
@RequestMapping("tamplate")
@ApiOperation("事件模板分页查询接口")
public JSONObject tamplate(){
return shangTangService.template();
}
/**
* 定时插入场景任务列表
*
*/
@RequestMapping("insertTaskList")
@ApiOperation("场景任务列表插入")
//@Scheduled(cron = "0 */1 * * * ?")
//@Transactional
public void insertTaskList(){
taskListControllerDao.deleteAll();
JSONObject jobj = this.tamplate();
JSONObject datajobj = jobj.getJSONObject("data");
JSONArray tamplateList = datajobj.getJSONArray("dataList");
//JSONArray tamplateList = jobj.getJSONArray("data");//构建JSONArray数组
for (int i = 0 ; i < tamplateList.size();i++) {
Map<String, Object> key = (Map<String, Object>) tamplateList.get(i);
String eventType = (String) key.get("eventType");
String eventCnName = (String)key.get("eventCnName");
JSONObject taskListBody = shangTangService.tasklist(eventType);
if (taskListBody.size()>0){
JSONObject taskdatajobj = taskListBody.getJSONObject("data");
if (taskdatajobj!=null){
JSONArray taskdatajobjJSONArray = taskdatajobj.getJSONArray("dataList");
if (taskdatajobjJSONArray!=null){
for (int j = 0 ; j < taskdatajobjJSONArray.size();j++) {
Map<String, Object> key1 = (Map<String, Object>)taskdatajobjJSONArray.get(j);
String taskSerial = (String) key1.get("taskSerial");
Integer taskStatus = (Integer) key1.get("taskStatus");
JSONObject taskDetailObj = shangTangService.tasklistDetail(taskSerial);
JSONObject taskDetail = taskDetailObj.getJSONObject("data");
TaskListControllerEntity taskListobj = new TaskListControllerEntity();
if (taskDetail!=null){
String taskName = taskDetail.getString("taskName");
taskListobj .setTaskName(taskName);
}else{
taskListobj .setTaskName("任务停止");
}
taskListobj .setTaskSerial(taskSerial);
taskListobj.setTaskStatus(taskStatus);
taskListobj .setEventType(eventType);
taskListobj .setEventCnName(eventCnName);
taskListControllerDao.insert(taskListobj);
}
}
}
}
}
}
}

View File

@ -0,0 +1,163 @@
package io.renren.modules.taskList.controller;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.taskList.dao.TaskListControllerDao;
import io.renren.modules.taskList.dto.TaskListControllerDTO;
import io.renren.modules.taskList.entity.TaskListControllerEntity;
import io.renren.modules.taskList.excel.TaskListControllerExcel;
import io.renren.modules.taskList.service.TaskListControllerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@RestController
@RequestMapping("/taskList/tasklistcontroller")
@Api(tags="任务列表查询")
public class TaskListController {
@Autowired
private TaskListControllerService taskListControllerService;
@Autowired
private TaskListControllerDao taskListControllerDao;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("taskList:tasklistcontroller:page")
public Result<PageData<TaskListControllerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<TaskListControllerDTO> page = taskListControllerService.page(params);
return new Result<PageData<TaskListControllerDTO>>().ok(page);
}
@GetMapping("/selectTaskList")
@ApiOperation("根据分页以及任务名称状态查询数据")
// @RequiresPermissions("taskList:tasklistcontroller:info")
public Map<String,Object> get(
@RequestParam(value = "taskName",required = false) String taskName,
@RequestParam(value = "taskStatus",required = false) Integer taskStatus,
@RequestParam(value = "page",required = true,defaultValue = "1") Integer page,
@RequestParam(value = "pageSize",required = true,defaultValue = "10") Integer pageSize
){
Page<TaskListControllerEntity> page1 = new Page<>(page,pageSize);
QueryWrapper<TaskListControllerEntity> queryWrapper = new QueryWrapper<>();
if (taskName!=null){
if (!StringUtils.isEmpty(taskName)) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
queryWrapper.like("task_name",taskName);
}
}
if (taskStatus!=null){
if (!StringUtils.isEmpty(taskStatus.toString())) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
queryWrapper.eq("task_status",taskStatus);
}
}
taskListControllerDao.selectPage(page1,queryWrapper);
List<TaskListControllerEntity> taskEntityList = page1.getRecords();
long num = page1.getTotal();
Map<String,Object> map = new HashMap<>();
if (taskEntityList.size()>0){
map.put("msg",200);//查询成功
map.put("taskEntityList",taskEntityList);
map.put("num",num);
}else {
map.put("msg",501);//查询失败
}
return map;
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("taskList:tasklistcontroller:save")
public Result save(@RequestBody TaskListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
taskListControllerService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("taskList:tasklistcontroller:update")
public Result update(@RequestBody TaskListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
taskListControllerService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("taskList:tasklistcontroller:delete")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
taskListControllerService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("taskList:tasklistcontroller:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<TaskListControllerDTO> list = taskListControllerService.list(params);
ExcelUtils.exportExcelToTarget(response, null, "test", list, TaskListControllerExcel.class);
}
}

View File

@ -0,0 +1,22 @@
package io.renren.modules.taskList.dao;
import io.renren.common.dao.BaseDao;
import io.renren.modules.taskList.entity.TaskListControllerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Mapper
@Resource
@Repository
public interface TaskListControllerDao extends BaseDao<TaskListControllerEntity> {
void deleteAll();
}

View File

@ -0,0 +1,28 @@
package io.renren.modules.taskList.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ApiModel(value = "test")
public class TaskListControllerDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String taskSerial;
private String taskName;
@ApiModelProperty(value = "1:运行中,2:已结束,3:异常,4:待启动,5:已停止")
private Integer taskStatus;
private String eventType;
private String eventCnName;
}

View File

@ -0,0 +1,29 @@
package io.renren.modules.taskList.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("tb_task_list")
public class TaskListControllerEntity {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
private String taskSerial;
private String taskName;
/**
* :运行中,2:已结束,3:异常,4:待启动,5:已停止
*/
private Integer taskStatus;
private String eventType;
private String eventCnName;
}

View File

@ -0,0 +1,32 @@
package io.renren.modules.taskList.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ContentRowHeight(20)
@HeadRowHeight(20)
@ColumnWidth(25)
public class TaskListControllerExcel {
@ExcelProperty(value = "Integer", index = 0)
private Integer id;
@ExcelProperty(value = "String", index = 1)
private String taskSerial;
@ExcelProperty(value = "String", index = 2)
private String taskName;
@ExcelProperty(value = ":运行中,2:已结束,3:异常,4:待启动,5:已停止", index = 3)
private Integer taskStatus;
@ExcelProperty(value = "String", index = 4)
private String eventType;
@ExcelProperty(value = "String", index = 5)
private String eventCnName;
}

View File

@ -0,0 +1,151 @@
package io.renren.modules.taskList.service;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
@Log4j2
public class ShangTangService {
@Resource
private RestTemplate restTemplate;
//1.登录
//2.获取token
public String shangtangToken () {
String url = "http://10.132.191.54:10270/whale-open-api/tenant/token";
Map<String,Object> map = new HashMap<>();
map.put("accessKey","a1ddCV7z7Jhv0SBGx5O3hblO");
map.put("secretKey","glIixzORLgoFJz0VdF1aXICR");
ResponseEntity<JSONObject> responseEntity;
try {
responseEntity = restTemplate.postForEntity(url,map,JSONObject.class);
JSONObject body = responseEntity.getBody();
JSONObject data = body.getJSONObject("data");
String token = data.getString("token");
log.info("get token:{}", body.toJSONString());
return token;
} catch (Exception e) {
log.info("[shangtangToken] exception:{}", e.getMessage());
return null;
}
}
//订阅任务下发接口
public JSONObject subscribe(){
String token = this.shangtangToken();
String url = "https://10.132.191.54:10270/whale-open-api/subscribe";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
headers.add("tid","default");
Map<String,Object> map = new HashMap<>();
map.put("callBackUrl","https://15.2.23.163:7010/STapi/project/receive");
// map.put("certPubKey","");
map.put("subscribeType",3);
// map.put("taskId","serial");
ResponseEntity<JSONObject> responseEntity;
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(map), headers);
try {
responseEntity = restTemplate.exchange(url, HttpMethod.POST,entity,JSONObject.class);
JSONObject body = responseEntity.getBody();
return body;
}catch (Exception e){
log.info( "[subscribe] exception:{}",e.getMessage());
return null;
}
}
//事件模板分页查询接口
public JSONObject template(){
String token = this.shangtangToken();
String url = "http://10.132.191.54:10270/whale-open-api/scenario/event/template?pageNum=1&pageSize=1000";
HttpHeaders headers = new HttpHeaders();
headers.add("token",token);
headers.add("tid","default");
ResponseEntity<JSONObject> responseEntity;
try {
responseEntity = restTemplate.exchange(url,HttpMethod.GET,new HttpEntity<>(headers),JSONObject.class);
JSONObject jsonObject = responseEntity.getBody();
return jsonObject;
} catch (Exception e) {
log.info("[template] exception:{}", e.getMessage());
return null;
}
}
//场景任务列表查询接口
public JSONObject tasklist(String eventType){
String token = this.shangtangToken();
String url = "http://10.132.191.54:10270/whale-open-api/scenario/event-task/list";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
headers.add("tid","default");
//需要传的参数
// "eventType": "${appletId}-${eventType}", // 事件唯一标识
// "pageNum": "integer (int32)",
// "pageSize": "integer (int32)",
// "taskName": "string", //任务名称
// "taskSerial": "string", //任务serial
// "taskStatus": "1:运行中,2:已结束,3:异常,4:待启动,5:已停止"
Map<String,Object> map = new HashMap<>();
map.put("eventType",eventType);
map.put("pageNum",1);
map.put("pageSize",100);
ResponseEntity<JSONObject> responseEntity;
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(map), headers);
try {
responseEntity = restTemplate.exchange(url, HttpMethod.POST,entity,JSONObject.class);
JSONObject taskListBody = responseEntity.getBody();
return taskListBody;
}catch (Exception e){
log.info( "[tasklist] exception:{}",e.getMessage());
return null;
}
}
//场景任务详情查询接口
public JSONObject tasklistDetail(String taskSerial){
String token = this.shangtangToken();
String url = "http://10.132.191.54:10270/whale-open-api/scenario/event-task/"+taskSerial;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
headers.add("tid","default");
ResponseEntity<JSONObject> responseEntity;
HttpEntity<String> entity = new HttpEntity<>( headers);
try {
responseEntity = restTemplate.exchange(url, HttpMethod.GET,entity,JSONObject.class);
JSONObject taskListDetailBody = responseEntity.getBody();
return taskListDetailBody;
}catch (Exception e){
log.info( "[tasklist] exception:{}",e.getMessage());
return null;
}
}
}

View File

@ -0,0 +1,16 @@
package io.renren.modules.taskList.service;
import io.renren.common.service.CrudService;
import io.renren.modules.taskList.dto.TaskListControllerDTO;
import io.renren.modules.taskList.entity.TaskListControllerEntity;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
public interface TaskListControllerService extends CrudService<TaskListControllerEntity, TaskListControllerDTO> {
}

View File

@ -0,0 +1,30 @@
package io.renren.modules.taskList.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.taskList.dao.TaskListControllerDao;
import io.renren.modules.taskList.dto.TaskListControllerDTO;
import io.renren.modules.taskList.entity.TaskListControllerEntity;
import io.renren.modules.taskList.service.TaskListControllerService;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Service
public class TaskListControllerServiceImpl extends CrudServiceImpl<TaskListControllerDao, TaskListControllerEntity, TaskListControllerDTO> implements TaskListControllerService {
@Override
public QueryWrapper<TaskListControllerEntity> getWrapper(Map<String, Object> params){
QueryWrapper<TaskListControllerEntity> wrapper = new QueryWrapper<>();
return wrapper;
}
}

View File

@ -0,0 +1,111 @@
package io.renren.modules.warningList.controller;
import com.alibaba.fastjson.JSONObject;
import io.renren.modules.warningList.dao.WarningListControllerDao;
import io.renren.modules.warningList.entity.WarningListControllerEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@RestController
@RequestMapping("STapi/project")
@Api(tags = "订阅任务下发接口")
@Log4j2
public class ShangTangWarningController {
@Resource
WarningListControllerDao warningListControllerDao;
@PostMapping("receiveSubscribe")
@ApiOperation("订阅任务下发接口")
public void receiveSubscribe(HttpServletRequest request) throws IOException {
ServletInputStream ris = request.getInputStream();
StringBuilder content = new StringBuilder();
byte[] b = new byte[1024];
int lens = -1;
while ((lens = ris.read(b)) > 0) {
content.append(new String(b, 0, lens));
}
String strcont = content.toString();// 内容
System.out.println(strcont);
JSONObject jsonObject = JSONObject.parseObject(strcont);
WarningListControllerEntity event = new WarningListControllerEntity();
event.setEventCnName(jsonObject.getString("eventAlias"));
event.setEventSerial(jsonObject.getString("eventSerial"));
JSONObject attributes = jsonObject.getJSONObject("attributes");
if (attributes==null){
}else {
JSONObject text = attributes.getJSONObject("text");
if (text == null){
}else {
event.setVehicle(text.getString("valueDescription"));
}
JSONObject color = attributes.getJSONObject("color");
if (color == null) {
} else {
event.setColor(color.getString("valueDescription"));
}
JSONObject largeVehicle = attributes.getJSONObject("large_vehicle");
if (largeVehicle == null) {
} else {
event.setVehicle(largeVehicle.getString("valueDescription"));
}
JSONObject trainingVehicle = attributes.getJSONObject("training_vehicle");
if (trainingVehicle == null) {
} else {
event.setVehicle(trainingVehicle.getString("valueDescription"));
}
JSONObject smallVehicle = attributes.getJSONObject("small_vehicle");
if (smallVehicle == null) {
} else {
event.setVehicle(smallVehicle.getString("valueDescription"));
}
JSONObject aClass = attributes.getJSONObject("class");
if (aClass == null) {
} else {
event.setClasses(aClass.getString("valueDescription"));
}
}
JSONObject camera = jsonObject.getJSONObject("camera");
if(camera==null){
}else {
event.setCameraName(camera.getString("cameraName"));
event.setDistrict(camera.getString("district"));
event.setLatitude(camera.getBigDecimal("latitude"));
event.setLongitude(camera.getBigDecimal("longitude"));
}
JSONObject image = jsonObject.getJSONObject("image");
if(image==null){
}else{
String images = image.getString("imageUrl");
String all = images.replaceAll(images.substring(19, 26), "7:8070");
event.setImageUrl(all);
}
event.setTaskId(jsonObject.getString("taskId"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//要转换的时间格式
Date date;
try {
date = sdf.parse(jsonObject.getString("captureTime"));
event.setCaptureTime(date);
}catch (Exception e){
e.printStackTrace();
}
event.setTrackEvent(jsonObject.getString("trackEvent"));
warningListControllerDao.insert(event);
log.info(event);
}
}

View File

@ -0,0 +1,166 @@
package io.renren.modules.warningList.controller;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.warningList.dao.WarningListControllerDao;
import io.renren.modules.warningList.dto.WarningListControllerDTO;
import io.renren.modules.warningList.entity.WarningListControllerEntity;
import io.renren.modules.warningList.excel.WarningListControllerExcel;
import io.renren.modules.warningList.service.WarningListControllerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@RestController
@RequestMapping("warningList/warninglistcontroller")
@Api(tags="告警信息查询")
public class WarningListController {
@Autowired
private WarningListControllerService warningListControllerService;
@Resource
private WarningListControllerDao warningListControllerDao;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("warningList:warninglistcontroller:page")
public Result<PageData<WarningListControllerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<WarningListControllerDTO> page = warningListControllerService.page(params);
return new Result<PageData<WarningListControllerDTO>>().ok(page);
}
@GetMapping("selectWarningList")
@ApiOperation("查询告警信息")
//@RequiresPermissions("warningList:warninglistcontroller:info")
public Map<String, Object> get(
@RequestParam(value = "eventCnName",required = false) String eventCnName,
@RequestParam(value = "beginTime",required = false) String beginTime,
@RequestParam(value = "endTime",required = false) String endTime,
@RequestParam(value = "page",required = true,defaultValue = "1") Integer page,
@RequestParam(value = "pageSize",required = true,defaultValue = "10") Integer pageSize
) throws ParseException {
Page<WarningListControllerEntity> page1 = new Page<>(page,pageSize);
QueryWrapper<WarningListControllerEntity> queryWrapper = new QueryWrapper<>();
if (eventCnName!=null){
if (!StringUtils.isEmpty(eventCnName)) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
queryWrapper.like("event_cn_name",eventCnName);
}
}
if (beginTime!=null && endTime!=null){
if (!StringUtils.isEmpty(beginTime) && !StringUtils.isEmpty(endTime)) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//要转换的时间格式
Date dateBegin = sdf.parse(beginTime);
Date dateEnd = sdf.parse(endTime);
queryWrapper.between("capture_time",dateBegin,dateEnd);
}
}
warningListControllerDao.selectPage(page1,queryWrapper);
List<WarningListControllerEntity> warningEntityList = page1.getRecords();
long num = page1.getTotal();
Map<String,Object> map = new HashMap<>();
if (warningEntityList.size()>0){
map.put("msg",200);//查询成功
map.put("num",num);
map.put("warningEntityList",warningEntityList);
}else {
map.put("msg",501);//查询失败
}
return map;
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("warningList:warninglistcontroller:save")
public Result save(@RequestBody WarningListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
warningListControllerService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("warningList:warninglistcontroller:update")
public Result update(@RequestBody WarningListControllerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
warningListControllerService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("warningList:warninglistcontroller:delete")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
warningListControllerService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("warningList:warninglistcontroller:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<WarningListControllerDTO> list = warningListControllerService.list(params);
ExcelUtils.exportExcelToTarget(response, null, "test", list, WarningListControllerExcel.class);
}
}

View File

@ -0,0 +1,16 @@
package io.renren.modules.warningList.dao;
import io.renren.common.dao.BaseDao;
import io.renren.modules.warningList.entity.WarningListControllerEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Mapper
public interface WarningListControllerDao extends BaseDao<WarningListControllerEntity> {
}

View File

@ -0,0 +1,44 @@
package io.renren.modules.warningList.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ApiModel(value = "test")
public class WarningListControllerDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "事件名称")
private String eventCnName;
private String eventSerial;
private String color;
@ApiModelProperty(value = "车牌")
private String vehicle;
private String classes;
@ApiModelProperty(value = "摄像头名称")
private String cameraName;
@ApiModelProperty(value = "位置")
private String district;
@ApiModelProperty(value = "经度")
private BigDecimal latitude;
@ApiModelProperty(value = "纬度")
private BigDecimal longitude;
@ApiModelProperty(value = "图片路径")
private String imageUrl;
private String taskId;
private Date captureTime;
private String trackEvent;
}

View File

@ -0,0 +1,55 @@
package io.renren.modules.warningList.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
import java.math.BigDecimal;
import java.util.Date;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("tb_warning_list")
public class WarningListControllerEntity {
private static final long serialVersionUID = 1L;
@TableId
private Long id;
private String eventCnName;//任务名称
private String eventSerial;//任务类型
private String color;//车辆颜色
/**
* 车牌
*/
private String vehicle;
private String classes;
/**
* 摄像头名称
*/
private String cameraName;
/**
* 位置
*/
private String district;
/**
* 经度
*/
private BigDecimal latitude;
/**
* 纬度
*/
private BigDecimal longitude;
/**
* 图片路径
*/
private String imageUrl;
private String taskId;
private Date captureTime;
private String trackEvent;
}

View File

@ -0,0 +1,50 @@
package io.renren.modules.warningList.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Data
@ContentRowHeight(20)
@HeadRowHeight(20)
@ColumnWidth(25)
public class WarningListControllerExcel {
@ExcelProperty(value = "Long", index = 0)
private Long id;
@ExcelProperty(value = "事件名称", index = 1)
private String eventCnName;
@ExcelProperty(value = "String", index = 2)
private String eventSerial;
@ExcelProperty(value = "String", index = 3)
private String color;
@ExcelProperty(value = "车牌", index = 4)
private String vehicle;
@ExcelProperty(value = "String", index = 5)
private String classes;
@ExcelProperty(value = "摄像头名称", index = 6)
private String cameraName;
@ExcelProperty(value = "位置", index = 7)
private String district;
@ExcelProperty(value = "经度", index = 8)
private BigDecimal latitude;
@ExcelProperty(value = "纬度", index = 9)
private BigDecimal longitude;
@ExcelProperty(value = "图片路径", index = 10)
private String imageUrl;
@ExcelProperty(value = "String", index = 11)
private String taskId;
@ExcelProperty(value = "Date", index = 12)
private Date captureTime;
@ExcelProperty(value = "String", index = 13)
private String trackEvent;
}

View File

@ -0,0 +1,15 @@
package io.renren.modules.warningList.service;
import io.renren.common.service.CrudService;
import io.renren.modules.warningList.dto.WarningListControllerDTO;
import io.renren.modules.warningList.entity.WarningListControllerEntity;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
public interface WarningListControllerService extends CrudService<WarningListControllerEntity, WarningListControllerDTO> {
}

View File

@ -0,0 +1,34 @@
package io.renren.modules.warningList.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.constant.Constant;
import io.renren.modules.warningList.dao.WarningListControllerDao;
import io.renren.modules.warningList.dto.WarningListControllerDTO;
import io.renren.modules.warningList.entity.WarningListControllerEntity;
import io.renren.modules.warningList.service.WarningListControllerService;
import io.renren.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@Service
public class WarningListControllerServiceImpl extends CrudServiceImpl<WarningListControllerDao, WarningListControllerEntity, WarningListControllerDTO> implements WarningListControllerService {
@Override
public QueryWrapper<WarningListControllerEntity> getWrapper(Map<String, Object> params){
QueryWrapper<WarningListControllerEntity> wrapper = new QueryWrapper<>();
return wrapper;
}
}

View File

@ -4,10 +4,12 @@ spring:
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://15.2.21.238:3310/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
username: root
password: Hisense2019
#Hisense2019
# #Oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe

View File

@ -0,0 +1,59 @@
server:
port: 8888
spring:
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/shangtangapi?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
username: root
password: 123456
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://15.2.21.238:3310/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
# username: root
# password: Hisense2019
#Hisense2019
#上传的静态资源配置
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 10
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#Oracle需要打开注释
validation-query: SELECT 1
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
#login-username: admin
#login-password: admin
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
#上传的静态资源配置
resource:
root_url: 15.2.21.238
path: /home/yth/files/
devModelFilePath: /home/yth/files/devModelFile
# 大数据部门相关配置
big_date:
name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人
hisense:
gateway:
url: http://devtest-security-app.hismarttv.com:8080

File diff suppressed because it is too large Load Diff

View File

@ -207,4 +207,66 @@
</if>
order by tab.create_date desc
</select>
<insert id="insertSelective">
insert into bs_ability_ai
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="isDelete != null">is_delete,</if>
<if test="updater != null">updater,</if>
<if test="name != null">name,</if>
<if test="version != null">version,</if>
<if test="visitUrl != null">visit_url,</if>
<if test="subtext != null">subtext,</if>
<if test="context != null">context,</if>
<if test="imgurl != null">imgurl,</if>
<if test="type != null">type,</if>
<if test="shareType != null">share_type,</if>
<if test="goal != null">goal,</if>
<if test="shareForm != null">share_form,</if>
<if test="field != null">field,</if>
<if test="scene != null">scene,</if>
<if test="deptId != null">dept_id,</if>
<if test="onlineDate != null">online_date,</if>
<if test="content != null">content,</if>
<if test="rank != null">rank,</if>
<if test="useInfo != null">use_info,</if>
<if test="remarks != null">remarks,</if>
<if test="isUp != null">is_up,</if>
<if test="updateDate != null">update_date,</if>
<if test="contentImg != null">content_img,</if>
<if test="id != null">id,</if>
<if test="creator != null">creator,</if>
<if test="createDate != null">create_date,</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">#{id,jdbcType=NUMERIC},</if>
<if test="isDelete != null">#{isDelete,jdbcType=VARCHAR},</if>
<if test="updater != null">#{updater,jdbcType=VARCHAR},</if>
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
<if test="version != null">#{version,jdbcType=VARCHAR},</if>
<if test="visitUrl != null">#{visitUrl,jdbcType=VARCHAR},</if>
<if test="subtext != null">#{subtext,jdbcType=VARCHAR},</if>
<if test="context != null">#{context,jdbcType=VARCHAR},</if>
<if test="imgurl != null">#{imgurl,jdbcType=VARCHAR},</if>
<if test="type != null">#{type,jdbcType=VARCHAR},</if>
<if test="shareType != null">#{shareType,jdbcType=VARCHAR},</if>
<if test="goal != null">#{goal,jdbcType=VARCHAR},</if>
<if test="shareForm != null">#{shareForm,jdbcType=VARCHAR},</if>
<if test="field != null">#{field,jdbcType=VARCHAR},</if>
<if test="scene != null">#{scene,jdbcType=VARCHAR},</if>
<if test="deptId != null">#{deptId,jdbcType=VARCHAR},</if>
<if test="onlineDate != null">#{onlineDate,jdbcType=VARCHAR},</if>
<if test="content != null">#{content,jdbcType=VARCHAR},</if>
<if test="rank != null">#{rank,jdbcType=VARCHAR},</if>
<if test="useInfo != null">#{useInfo,jdbcType=VARCHAR},</if>
<if test="remarks != null">#{remarks,jdbcType=VARCHAR},</if>
<if test="isUp != null">#{isUp,jdbcType=VARCHAR},</if>
<if test="updateDate != null">#{updateDate,jdbcType=VARCHAR},</if>
<if test="contentImg != null">#{contentImg,jdbcType=VARCHAR},</if>
<if test="id != null">#{id,jdbcType=NUMERIC},</if>
<if test="creator != null">#{creator,jdbcType=NUMERIC},</if>
<if test="createDate != null">#{createDate,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
</mapper>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.renren.modules.eventListTest.dao.EventListControllerDao">
<resultMap type="io.renren.modules.eventListTest.entity.EventListControllerEntity" id="eventListControllerMap">
<result property="id" column="id"/>
<result property="eventType" column="event_type"/>
<result property="eventCnName" column="event_cn_name"/>
<result property="eventDesc" column="event_desc"/>
</resultMap>
</mapper>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.renren.modules.taskList.dao.TaskListControllerDao">
<resultMap type="io.renren.modules.taskList.entity.TaskListControllerEntity" id="taskListControllerMap">
<result property="id" column="id"/>
<result property="taskSerial" column="task_serial"/>
<result property="taskName" column="task_name"/>
<result property="taskStatus" column="task_status"/>
<result property="eventType" column="event_type"/>
<result property="eventCnName" column="event_cn_name"/>
</resultMap>
<delete id="deleteAll">
Delete from tb_task_list where 1=1
</delete>
</mapper>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.renren.modules.warningList.dao.WarningListControllerDao">
<resultMap type="io.renren.modules.warningList.entity.WarningListControllerEntity" id="warningListControllerMap">
<result property="id" column="id"/>
<result property="eventCnName" column="event_cn_name"/>
<result property="eventSerial" column="event_serial"/>
<result property="color" column="color"/>
<result property="vehicle" column="vehicle"/>
<result property="classes" column="classes"/>
<result property="cameraName" column="camera_name"/>
<result property="district" column="district"/>
<result property="latitude" column="latitude"/>
<result property="longitude" column="longitude"/>
<result property="imageUrl" column="image_url"/>
<result property="taskId" column="task_id"/>
<result property="captureTime" column="capture_time"/>
<result property="trackEvent" column="track_event"/>
</resultMap>
</mapper>