小久哥
3 years ago
6 changed files with 129 additions and 0 deletions
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.task.vo; |
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.ToString; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.Date; |
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
||||
@ApiModel("管理后台 - 农场项目分页 Request VO") |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ToString(callSuper = true) |
||||
public class TaskPageSearchReqVO extends PageParam { |
||||
|
||||
@ApiModelProperty(value = "") |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "") |
||||
private String content; |
||||
|
||||
@ApiModelProperty(value = "") |
||||
private String resources; |
||||
|
||||
@ApiModelProperty(value = "") |
||||
private Object images; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "开始") |
||||
private LocalDateTime beginPlanStartTime; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "结束") |
||||
private LocalDateTime endPlanStartTime; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "开始") |
||||
private LocalDateTime beginPlanEndTime; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "结束") |
||||
private LocalDateTime endPlanEndTime; |
||||
|
||||
@ApiModelProperty(value = "优先级") |
||||
private Integer weight; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "开始") |
||||
private LocalDateTime beginCreateTime; |
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
@ApiModelProperty(value = "结束") |
||||
private LocalDateTime endCreateTime; |
||||
|
||||
} |
@ -0,0 +1,39 @@
|
||||
<?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="cn.iocoder.yudao.module.farm.dal.mysql.task.TaskMapper"> |
||||
|
||||
<!-- |
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 |
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 |
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 |
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
||||
--> |
||||
|
||||
<select id="getTaskSearchPage" resultType="cn.iocoder.yudao.module.farm.dal.dataobject.task.TaskDO"> |
||||
SELECT t.* FROM farm_task t |
||||
INNER JOIN farm_resource r |
||||
ON JSON_CONTAINS(t.resources, CONVERT(r.id, CHAR)) |
||||
AND 1 = 1 |
||||
<if test="name != null and name != '' "> |
||||
AND t.name like concat('%', #{name}, '%') |
||||
</if> |
||||
<if test="resources != null and resources != '' "> |
||||
AND r.name like concat('%', #{resources}, '%') |
||||
</if> |
||||
<if test="weight != null"> |
||||
AND t.weight = #{weight} |
||||
</if> |
||||
<if test="beginPlanStartTime != null and endPlanStartTime != null"> |
||||
AND t.plan_start_time <![CDATA[ >= ]]> #{beginPlanStartTime} AND t.plan_start_time <![CDATA[ <= ]]> #{endPlanStartTime} |
||||
</if> |
||||
<if test="beginPlanEndTime != null and endPlanEndTime != null"> |
||||
AND t.plan_end_time <![CDATA[ >= ]]> #{beginPlanEndTime} AND t.plan_end_time <![CDATA[ <= ]]> #{endPlanEndTime} |
||||
</if> |
||||
<if test="beginCreateTime != null and endCreateTime != null"> |
||||
AND t.create_time <![CDATA[ >= ]]> #{beginCreateTime} AND t.create_time <![CDATA[ <= ]]> #{endCreateTime} |
||||
</if> |
||||
GROUP BY t.id |
||||
LIMIT #{pageNo},#{pageSize} |
||||
</select> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue