diff --git a/RuoYi-Vue/ruoyi-admin/pom.xml b/RuoYi-Vue/ruoyi-admin/pom.xml index 305f574..323044c 100644 --- a/RuoYi-Vue/ruoyi-admin/pom.xml +++ b/RuoYi-Vue/ruoyi-admin/pom.xml @@ -16,7 +16,11 @@ </description> <dependencies> - + <dependency> + <groupId>cn.hutool</groupId> + <artifactId>hutool-all</artifactId> + <version>5.8.25</version> + </dependency> <!-- spring-boot-devtools --> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/AlarmController.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/AlarmController.java index df99b2f..523fc1b 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/AlarmController.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/AlarmController.java @@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -25,7 +26,7 @@ import java.util.List; @RestController @RequestMapping("algorithms/alarm") public class AlarmController extends BaseController { - @Autowired + @Resource private IAlarmService alarmService; /** diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/EventController.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/EventController.java index e466f9c..3b11d9e 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/EventController.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/EventController.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; /** @@ -30,7 +31,7 @@ import java.util.List; @RestController @RequestMapping("algorithms/event") public class EventController extends BaseController { - @Autowired + @Resource private IEventService eventService; /** diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/FireController.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/FireController.java new file mode 100644 index 0000000..ac69adc --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/controller/FireController.java @@ -0,0 +1,68 @@ +package com.ruoyi.page.controller; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.yingji.entity.Fire; +import com.yingji.entity.dto.request.FireFindRequest; +import com.yingji.service.FireService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.io.Serializable; + +/** + * 119数据(Fire)表控制层 + * + * @author wu + * @since 2024-06-05 09:24:14 + */ +@RestController +@RequestMapping("algorithms/fire") +@Api(tags = "119数据") +@Transactional(rollbackFor = Exception.class) +public class FireController extends BaseController { + /** + * 服务对象 + */ + @Resource + private FireService fireService; + + /** + * 分页条件查询所有数据 + * + * @param page 分页条件 + * @param fire 查询条件 + * @return 所有数据 + */ + @GetMapping + @ApiOperation(value = "分页条件查询119数据", response = Fire.class) + public AjaxResult page(Page<Fire> page, FireFindRequest fire) { + if (page.getSize() > 1000) { + page.setSize(1000); + } + return success(fireService.page(page, fire)); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + @ApiOperation(value = "通过主键查询单条119数据", response = Fire.class) + public AjaxResult getById(@PathVariable Serializable id) { + return success(fireService.getById(id)); + } + + +} + diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/Fire.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/Fire.java new file mode 100644 index 0000000..919d805 --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/Fire.java @@ -0,0 +1,117 @@ +package com.yingji.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 119数据(Fire)表实体类 + * + * @author wu + * @since 2024-06-05 09:24:14 + */ +@Data +@ApiModel("119数据实体类") +@TableName(value = "fire") +public class Fire implements Serializable { + + private static final long serialVersionUID = -96682169109217319L; + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + private String id; + /** + * 行政区划 + */ + @ApiModelProperty(value = "行政区划") + private String xzqh; + /** + * 案件编号 + */ + @ApiModelProperty(value = "案件编号") + private String ajbh; + /** + * 案件描述 + */ + @ApiModelProperty(value = "案件描述") + private String ajms; + /** + * 归队时间 + */ + @ApiModelProperty(value = "归队时间") + private Date gdsj; + private String jjyxm; + /** + * 时间戳 + */ + @ApiModelProperty(value = "时间戳") + private Date sjc; + /** + * 纬度 + */ + @ApiModelProperty(value = "纬度") + private String wd; + /** + * 经度 + */ + @ApiModelProperty(value = "经度") + private String jd; + /** + * 备注信息 + */ + @ApiModelProperty(value = "备注信息") + private String bcxx; + /** + * 结束时间 + */ + @ApiModelProperty(value = "结束时间") + private Date jssj; + /** + * 案发地址 + */ + @ApiModelProperty(value = "案发地址") + private String afdz; + /** + * 出动时间 + */ + @ApiModelProperty(value = "出动时间") + private Date cdsj; + /** + * 立案方式代码 + */ + @ApiModelProperty(value = "立案方式代码") + private String lafsdm; + /** + * topic + */ + @ApiModelProperty(value = "topic") + private String topic; + private Date xdsj; + /** + * 立案时间 + */ + @ApiModelProperty(value = "立案时间") + private Date lasj; + /** + * 行政区划名称 + */ + @ApiModelProperty(value = "行政区划名称") + private String xzqhmc; + /** + * 到达现场时间 + */ + @ApiModelProperty(value = "到达现场时间") + private Date ddxcsj; + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Date createTime; +} + diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java new file mode 100644 index 0000000..1ee8c37 --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java @@ -0,0 +1,57 @@ +package com.yingji.entity.dto.request; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 119查询请求类 + * + * @author wu + * @since 2024/4/30 下午3:59 + */ +@ApiModel(value = "119查询请求类") +@Data +public class FireFindRequest implements Serializable { + + + private static final long serialVersionUID = -3688091864596277161L; + + /** + * 开始时间 + */ + @ApiModelProperty("开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + /** + * 结束时间 + */ + @ApiModelProperty("结束时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + /** + * 案件编号 + */ + @ApiModelProperty(value = "案件编号") + private String ajbh; + /** + * 案件描述 + */ + @ApiModelProperty(value = "案件描述") + private String ajms; + + /** + * 案发地址 + */ + @ApiModelProperty(value = "案发地址") + private String afdz; +} diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/mapper/FireMapper.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/mapper/FireMapper.java new file mode 100644 index 0000000..4e6e644 --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/mapper/FireMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.page.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Fire; + +/** + * 119数据(Fire)表数据库访问层 + * + * @author wu + * @since 2024-06-05 09:24:14 + */ +public interface FireMapper extends BaseMapper<Fire> { + +} + diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/FireService.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/FireService.java new file mode 100644 index 0000000..d74bfad --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/FireService.java @@ -0,0 +1,25 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Fire; +import com.yingji.entity.dto.request.FireFindRequest; + +/** + * 119数据(Fire)表服务接口 + * + * @author wu + * @since 2024-06-05 09:24:14 + */ +public interface FireService extends IService<Fire> { + + /** + * 分页条件查询所有数据 + * + * @param page 分页条件 + * @param fire 查询条件 + * @return 所有数据 + */ + Page<Fire> page(Page<Fire> page, FireFindRequest fire); +} + diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/AlarmServiceImpl.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/AlarmServiceImpl.java index 4d5c56e..0ca328b 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/AlarmServiceImpl.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/AlarmServiceImpl.java @@ -9,6 +9,8 @@ import com.ruoyi.page.mapper.AlarmMapper; import com.ruoyi.page.domain.Alarm; import com.ruoyi.page.service.IAlarmService; +import javax.annotation.Resource; + /** * 报警事件Service业务层处理 * @@ -18,7 +20,7 @@ import com.ruoyi.page.service.IAlarmService; @Service public class AlarmServiceImpl implements IAlarmService { - @Autowired + @Resource private AlarmMapper alarmMapper; /** diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/EventServiceImpl.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/EventServiceImpl.java index c6ed4af..ab311ea 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/EventServiceImpl.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/EventServiceImpl.java @@ -7,6 +7,7 @@ import com.ruoyi.page.service.IEventService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; @@ -19,7 +20,7 @@ import java.util.List; @Service public class EventServiceImpl implements IEventService { - @Autowired + @Resource private EventMapper eventMapper; /** diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java new file mode 100644 index 0000000..122e844 --- /dev/null +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java @@ -0,0 +1,40 @@ +package com.ruoyi.page.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.page.mapper.FireMapper; +import com.yingji.entity.Fire; +import com.yingji.entity.dto.request.FireFindRequest; +import com.yingji.service.FireService; +import org.springframework.stereotype.Service; + +/** + * 119数据(Fire)表服务实现类 + * + * @author wu + * @since 2024-06-05 09:24:14 + */ +@Service("fireService") +public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements FireService { + + /** + * 分页条件查询所有数据 + * + * @param page 分页条件 + * @param fire 查询条件 + * @return 所有数据 + */ + @Override + public Page<Fire> page(Page<Fire> page, FireFindRequest fire) { + QueryWrapper<Fire> wrapper = new QueryWrapper<>(); + wrapper.like(StrUtil.isNotEmpty(fire.getAjbh()), "ajbh", fire.getAjbh()) + .ge(fire.getStartTime() != null, "create_time", fire.getStartTime()) + .le(fire.getEndTime() != null, "create_time", fire.getEndTime()) + .like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms()) + .like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz()); + return this.page(page, wrapper); + } +} + diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index 9c512c3..383af28 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -2,6 +2,9 @@ package com.ruoyi.web.core.config; import java.util.ArrayList; import java.util.List; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -61,7 +64,7 @@ public class SwaggerConfig { // 是否启用Swagger .enable(enabled) //分组名称 - .groupName("江宁城管") + .groupName("1") // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) .apiInfo(apiInfo()) // 设置哪些接口暴露给Swagger展示 @@ -73,9 +76,9 @@ public class SwaggerConfig { // 扫描所有 .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build() - .pathMapping(pathMapping); + .pathMapping(pathMapping) // 排除mybatis-plus的分页参数 - //.ignoredParameterTypes(Page.class, IPage.class); + .ignoredParameterTypes(Page.class, IPage.class); } @@ -86,9 +89,9 @@ public class SwaggerConfig { // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 - .title("江宁城管") + .title("1") // 描述 - .description("描述:用于江宁城管系统") + .description("描述:1") // 作者信息 .contact(new Contact(ruoyiConfig.getName(), null, null)) // 版本 diff --git a/RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml b/RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml index a3a7ec1..661af40 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml +++ b/RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 123456 + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml b/RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml index a6c8a69..ea8ecf3 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml +++ b/RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml @@ -99,8 +99,8 @@ token: # 令牌有效期(默认30分钟) expireTime: 30 -# MyBatis配置 -mybatis: +# MyBatis Plus配置 +mybatis-plus: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 @@ -116,7 +116,7 @@ pagehelper: # Swagger配置 knife4j: - enable: false + enable: true # 防止XSS攻击 diff --git a/RuoYi-Vue/ruoyi-common/pom.xml b/RuoYi-Vue/ruoyi-common/pom.xml index 71fea1e..07e34d1 100644 --- a/RuoYi-Vue/ruoyi-common/pom.xml +++ b/RuoYi-Vue/ruoyi-common/pom.xml @@ -16,7 +16,11 @@ </description> <dependencies> - + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>3.5.1</version> + </dependency> <!-- Spring框架基本的核心工具 --> <dependency> <groupId>org.springframework</groupId> diff --git a/RuoYi-Vue/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java b/RuoYi-Vue/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java new file mode 100644 index 0000000..f712180 --- /dev/null +++ b/RuoYi-Vue/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java @@ -0,0 +1,62 @@ +package com.ruoyi.framework.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * Mybatis Plus 配置 + * + * @author ruoyi + */ +@EnableTransactionManagement(proxyTargetClass = true) +@Configuration +public class MybatisPlusConfig +{ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() + { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 分页插件 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 乐观锁插件 + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + // 阻断插件 + interceptor.addInnerInterceptor(blockAttackInnerInterceptor()); + return interceptor; + } + + /** + * 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html + */ + public PaginationInnerInterceptor paginationInnerInterceptor() + { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + // 设置数据库类型为mysql + paginationInnerInterceptor.setDbType(DbType.MYSQL); + // 设置最大单页限制数量,默认 500 条,-1 不受限制 + paginationInnerInterceptor.setMaxLimit(-1L); + return paginationInnerInterceptor; + } + + /** + * 乐观锁插件 https://baomidou.com/guide/interceptor-optimistic-locker.html + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() + { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * 如果是对全表的删除或更新操作,就会终止该操作 https://baomidou.com/guide/interceptor-block-attack.html + */ + public BlockAttackInnerInterceptor blockAttackInnerInterceptor() + { + return new BlockAttackInnerInterceptor(); + } +} \ No newline at end of file diff --git a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml index eed14c2..2ea3bf9 100644 --- a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml +++ b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml @@ -68,52 +68,53 @@ <include refid="selectEventVo"/> where event_id = #{eventId} </select> - - <select id="selectEventList" resultType="com.ruoyi.system.domain.Event"> - SELECT * - FROM event - <where> - <if test="event.eventType != '转院'"> - AND event_type != '转院' - </if> - <if test="event.eventName !=null and event.eventName !=''"> - AND event_name LIKE CONCAT('%', #{event.eventName}, '%') - </if> - <if test="event.eventType !=null and event.eventType !=''"> - AND event_type = #{event.eventType} - </if> - <if test="event.eventLevel !=null and event.eventLevel !=''"> - AND event_level = #{event.eventLevel} - </if> - <if test="event.startTime != null"> - AND event_date_time >= #{event.startTime} - </if> - <if test="event.endTime != null"> - AND event_date_time <= #{event.endTime} - </if> - <if test="event.eventArea !=null and event.eventArea !=''"> - AND event_area LIKE CONCAT('%', #{event.eventArea}, '%') - </if> - <if test="event.eventAddress !=null and event.eventAddress !=''"> - AND event_address LIKE CONCAT('%', #{event.eventAddress}, '%') - </if> - <if test="event.sendAmbCount != null"> - AND send_amb_count = #{event.sendAmbCount} - </if> - <if test="event.eventDescribe !=null and event.eventDescribe !=''"> - AND event_describe LIKE CONCAT('%', #{event.eventDescribe}, '%') - </if> - <if test="event.alarmUnit !=null and event.alarmUnit !=''"> - AND alarm_unit LIKE CONCAT('%', #{event.alarmUnit}, '%') - </if> - <if test="event.alarmUnitContactor !=null and event.alarmUnitContactor !=''"> - AND alarm_unit_contactor LIKE CONCAT('%', #{event.alarmUnitContactor}, '%') - </if> - <if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''"> - AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%') - </if> - </where> + <select id="selectEventList" resultType="com.ruoyi.page.domain.Event"> + SELECT * + FROM event + <where> + <if test="event.eventType != '转院'"> + AND event_type != '转院' + </if> + <if test="event.eventName !=null and event.eventName !=''"> + AND event_name LIKE CONCAT('%', #{event.eventName}, '%') + </if> + <if test="event.eventType !=null and event.eventType !=''"> + AND event_type = #{event.eventType} + </if> + <if test="event.eventLevel !=null and event.eventLevel !=''"> + AND event_level = #{event.eventLevel} + </if> + <if test="event.startTime != null"> + AND event_date_time >= #{event.startTime} + </if> + <if test="event.endTime != null"> + AND event_date_time <= #{event.endTime} + </if> + <if test="event.eventArea !=null and event.eventArea !=''"> + AND event_area LIKE CONCAT('%', #{event.eventArea}, '%') + </if> + <if test="event.eventAddress !=null and event.eventAddress !=''"> + AND event_address LIKE CONCAT('%', #{event.eventAddress}, '%') + </if> + <if test="event.sendAmbCount != null"> + AND send_amb_count = #{event.sendAmbCount} + </if> + <if test="event.eventDescribe !=null and event.eventDescribe !=''"> + AND event_describe LIKE CONCAT('%', #{event.eventDescribe}, '%') + </if> + <if test="event.alarmUnit !=null and event.alarmUnit !=''"> + AND alarm_unit LIKE CONCAT('%', #{event.alarmUnit}, '%') + </if> + <if test="event.alarmUnitContactor !=null and event.alarmUnitContactor !=''"> + AND alarm_unit_contactor LIKE CONCAT('%', #{event.alarmUnitContactor}, '%') + </if> + <if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''"> + AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%') + </if> + </where> </select> + + <insert id="insertEvent" parameterType="Event"> insert into event <trim prefix="(" suffix=")" suffixOverrides=","> diff --git a/page/src/main/resources/application-dev.yml b/page/src/main/resources/application-dev.yml index 287eb22..9cbe9a0 100644 --- a/page/src/main/resources/application-dev.yml +++ b/page/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ spring: datasource: url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 123456 + password: root driverClassName: com.mysql.cj.jdbc.Driver