添加“scenic”、“scenic_config”相关CRUD代码
This commit is contained in:
parent
2040cf23a4
commit
dcd228f2c7
@ -8,6 +8,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
* @Date:2024/11/29 17:22
|
* @Date:2024/11/29 17:22
|
||||||
|
* 渲染机管理表
|
||||||
*/
|
*/
|
||||||
public interface RenderWorkerMapper {
|
public interface RenderWorkerMapper {
|
||||||
List<RenderWorkerEntity> list(RenderWorkerReqQuery renderWorkerReqQuery);
|
List<RenderWorkerEntity> list(RenderWorkerReqQuery renderWorkerReqQuery);
|
||||||
|
29
src/main/java/com/ycwl/basic/mapper/pc/ScenicMapper.java
Normal file
29
src/main/java/com/ycwl/basic/mapper/pc/ScenicMapper.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package com.ycwl.basic.mapper.pc;
|
||||||
|
|
||||||
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.req.ScenicReqQuery;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:longbinbin
|
||||||
|
* @Date:2024/12/2 10:07
|
||||||
|
* 景区管理表
|
||||||
|
*/
|
||||||
|
public interface ScenicMapper {
|
||||||
|
List<ScenicRespVO> list(ScenicReqQuery scenicReqQuery);
|
||||||
|
ScenicRespVO getById(Long id);
|
||||||
|
int add(ScenicEntity member);
|
||||||
|
int deleteById(Long id);
|
||||||
|
int update(ScenicEntity member);
|
||||||
|
int updateStatus(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改景区配置
|
||||||
|
* @param scenicConfigEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateConfigById(ScenicConfigEntity scenicConfigEntity);
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
package com.ycwl.basic.model.pc.renderWorker.resp;
|
package com.ycwl.basic.model.pc.renderWorker.resp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.ycwl.basic.model.pc.scenic.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:longbinbin
|
||||||
|
* @Date:2024/12/2 10:53
|
||||||
|
* 景区配置
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("scenic_config")
|
||||||
|
public class ScenicConfigEntity {
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 景区id
|
||||||
|
*/
|
||||||
|
private Long scenicId;
|
||||||
|
/**
|
||||||
|
* 启用时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 是否为默认
|
||||||
|
*/
|
||||||
|
private Integer isDefault;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.ycwl.basic.model.pc.scenic.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:longbinbin
|
||||||
|
* @Date:2024/12/02 10:24
|
||||||
|
* 景区管理表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("scenic")
|
||||||
|
public class ScenicEntity {
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 景区名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 景区介绍
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private BigDecimal longitude;
|
||||||
|
/***
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private BigDecimal latitude;
|
||||||
|
/**
|
||||||
|
* 半径(km)
|
||||||
|
*/
|
||||||
|
private BigDecimal radius;
|
||||||
|
/**
|
||||||
|
* 省份
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 状态 1启用0关闭
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
private Date createTime;
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.ycwl.basic.model.pc.scenic.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:longbinbin
|
||||||
|
* @Date:2024/12/02 10:24
|
||||||
|
* 景区管理表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("景区列表查询参数")
|
||||||
|
public class ScenicReqQuery {
|
||||||
|
/**
|
||||||
|
* 景区名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("景区名称")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 景区介绍
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("景区介绍")
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("经度")
|
||||||
|
private BigDecimal longitude;
|
||||||
|
/***
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("纬度")
|
||||||
|
private BigDecimal latitude;
|
||||||
|
/**
|
||||||
|
* 半径(km)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("半径(km)")
|
||||||
|
private BigDecimal radius;
|
||||||
|
/**
|
||||||
|
* 省份
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("省份")
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("城市")
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String area;
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 状态 1启用0关闭
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("状态 1启用0关闭")
|
||||||
|
private String status;
|
||||||
|
private Date startTime;
|
||||||
|
private Date endTime;
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.ycwl.basic.model.pc.scenic.resp;
|
||||||
|
|
||||||
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:longbinbin
|
||||||
|
* @Date:2024/12/02 10:24
|
||||||
|
* 景区管理表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("查询景区列表响应参数")
|
||||||
|
public class ScenicRespVO {
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 景区名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("景区名称")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 景区介绍
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("景区介绍")
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("经度")
|
||||||
|
private BigDecimal longitude;
|
||||||
|
/***
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("纬度")
|
||||||
|
private BigDecimal latitude;
|
||||||
|
/**
|
||||||
|
* 半径(km)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("半径(km)")
|
||||||
|
private BigDecimal radius;
|
||||||
|
/**
|
||||||
|
* 省份
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("省份")
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("城市")
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String area;
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 状态 1启用0关闭
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("状态 1启用0关闭")
|
||||||
|
private String status;
|
||||||
|
private Date createTime;
|
||||||
|
private Date updateTime;
|
||||||
|
@ApiModelProperty("景区配置")
|
||||||
|
private ScenicConfigEntity scenicConfig;
|
||||||
|
}
|
126
src/main/resources/mapper/pc/ScenicMapper.xml
Normal file
126
src/main/resources/mapper/pc/ScenicMapper.xml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?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="com.ycwl.basic.mapper.pc.ScenicMapper">
|
||||||
|
<insert id="add">
|
||||||
|
insert into scenic(id, `name`, introduction, longitude, latitude, radius, province, city, area, address)
|
||||||
|
values (#{id}, #{name}, #{introduction}, #{longitude}, #{latitude}, #{radius}, #{province}, #{city}, #{area}, #{address})
|
||||||
|
</insert>
|
||||||
|
<update id="update">
|
||||||
|
update
|
||||||
|
scenic
|
||||||
|
<set>
|
||||||
|
<if test="name!=null and name!=''">
|
||||||
|
`name`=#{name},
|
||||||
|
</if>
|
||||||
|
<if test="introduction!=null and introduction!=''">
|
||||||
|
introduction=#{introduction},
|
||||||
|
</if>
|
||||||
|
<if test="longitude!=null">
|
||||||
|
longitude=#{longitude},
|
||||||
|
</if>
|
||||||
|
<if test="latitude!=null">
|
||||||
|
latitude=#{latitude},
|
||||||
|
</if>
|
||||||
|
<if test="radius!=null">
|
||||||
|
radius=#{radius},
|
||||||
|
</if>
|
||||||
|
<if test="province!=null and province!=''">
|
||||||
|
province=#{province},
|
||||||
|
</if>
|
||||||
|
<if test="city!=null and city!=''">
|
||||||
|
city=#{city},
|
||||||
|
</if>
|
||||||
|
<if test="area!=null and area!=''">
|
||||||
|
area=#{area},
|
||||||
|
</if>
|
||||||
|
<if test="address!=null and address!=''">
|
||||||
|
address=#{address},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="updateStatus">
|
||||||
|
update
|
||||||
|
scenic
|
||||||
|
set status = (CASE
|
||||||
|
status
|
||||||
|
WHEN 1 THEN
|
||||||
|
0
|
||||||
|
WHEN 0 THEN
|
||||||
|
1
|
||||||
|
END)
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="updateConfigById">
|
||||||
|
update scenic_config
|
||||||
|
<set>
|
||||||
|
<if test="startTime!=null">
|
||||||
|
start_time=#{startTime},
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null">
|
||||||
|
end_time=#{endTime},
|
||||||
|
</if>
|
||||||
|
<if test="isDefault!=null">
|
||||||
|
is_default=#{isDefault},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<delete id="deleteById">
|
||||||
|
delete from scenic where id = #{id}
|
||||||
|
</delete>
|
||||||
|
<select id="list" resultMap="scenicAndConfig">
|
||||||
|
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||||
|
c.start_time, c.end_time, c.is_default, c.create_time
|
||||||
|
from scenic s
|
||||||
|
left join scenic_config c on s.id = c.id
|
||||||
|
<where>
|
||||||
|
<if test="name!=null and name!=''">
|
||||||
|
and locate(#{name},`name`) > 0
|
||||||
|
</if>
|
||||||
|
<if test="province!=null and province!=''">
|
||||||
|
and locate(#{province},`province`) > 0
|
||||||
|
</if>
|
||||||
|
<if test="city!=null and city!=''">
|
||||||
|
and locate(#{city},`city`) > 0
|
||||||
|
</if>
|
||||||
|
<if test="area!=null and area!=''">
|
||||||
|
and locate(#{area},`area`) > 0
|
||||||
|
</if>
|
||||||
|
<if test="status!=null">
|
||||||
|
and `status` = #{status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="getById" resultMap="scenicAndConfig">
|
||||||
|
select s.id, `name`, introduction, longitude, latitude, radius, province, city, area, address, `status`, s.create_time, update_time,
|
||||||
|
c.start_time, c.end_time, c.is_default, c.create_time
|
||||||
|
from scenic s
|
||||||
|
left join scenic_config c on s.id = c.id
|
||||||
|
where s.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="scenicAndConfig" type="com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO">
|
||||||
|
<id property="id" column="s.id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="introduction" column="introduction"/>
|
||||||
|
<result property="longitude" column="longitude"/>
|
||||||
|
<result property="latitude" column="latitude"/>
|
||||||
|
<result property="radius" column="radius"/>
|
||||||
|
<result property="province" column="province"/>
|
||||||
|
<result property="city" column="city"/>
|
||||||
|
<result property="area" column="area"/>
|
||||||
|
<result property="address" column="address"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<association property="scenicConfig" column="id" javaType="com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity">
|
||||||
|
<id property="id" column="c.id"/>
|
||||||
|
<result property="scenicId" column="s.id"/>
|
||||||
|
<result property="startTime" column="c.start_time"/>
|
||||||
|
<result property="endTime" column="c.end_time"/>
|
||||||
|
<result property="isDefault" column="c.is_default"/>
|
||||||
|
<result property="createTime" column="c.create_time"/>
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user