王兴琳
5 months ago
11 changed files with 466 additions and 8 deletions
@ -0,0 +1,106 @@ |
|||
package com.zc.business.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
import com.zc.business.domain.DcRoadConditionInformation; |
|||
import com.zc.business.service.IDcRoadConditionInformationService; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
|
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 路况信息Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-07-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/information") |
|||
public class DcRoadConditionInformationController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IDcRoadConditionInformationService dcRoadConditionInformationService; |
|||
|
|||
/** |
|||
* 查询路况信息列表 |
|||
*/ |
|||
//@PreAuthorize("@ss.hasPermi('system:information:list')")
|
|||
@GetMapping("/list") |
|||
public TableDataInfo list(DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
startPage(); |
|||
List<DcRoadConditionInformation> list = dcRoadConditionInformationService.selectDcRoadConditionInformationList(dcRoadConditionInformation); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出路况信息列表 |
|||
*/ |
|||
//@PreAuthorize("@ss.hasPermi('system:information:export')")
|
|||
@Log(title = "路况信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
List<DcRoadConditionInformation> list = dcRoadConditionInformationService.selectDcRoadConditionInformationList(dcRoadConditionInformation); |
|||
ExcelUtil<DcRoadConditionInformation> util = new ExcelUtil<>(DcRoadConditionInformation.class); |
|||
util.exportExcel(response, list, "路况信息数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取路况信息详细信息 |
|||
*/ |
|||
//@PreAuthorize("@ss.hasPermi('system:information:query')")
|
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return AjaxResult.success(dcRoadConditionInformationService.selectDcRoadConditionInformationById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增路况信息 |
|||
*/ |
|||
// @PreAuthorize("@ss.hasPermi('system:information:add')")
|
|||
@Log(title = "路况信息", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
return toAjax(dcRoadConditionInformationService.insertDcRoadConditionInformation(dcRoadConditionInformation)); |
|||
} |
|||
|
|||
/** |
|||
* 修改路况信息 |
|||
*/ |
|||
// @PreAuthorize("@ss.hasPermi('system:information:edit')")
|
|||
@Log(title = "路况信息", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
return toAjax(dcRoadConditionInformationService.updateDcRoadConditionInformation(dcRoadConditionInformation)); |
|||
} |
|||
|
|||
/** |
|||
* 删除路况信息 |
|||
*/ |
|||
//@PreAuthorize("@ss.hasPermi('system:information:remove')")
|
|||
@Log(title = "路况信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(dcRoadConditionInformationService.deleteDcRoadConditionInformationByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
package com.zc.business.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 路况信息对象 dc_road_condition_information |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-07-02 |
|||
*/ |
|||
public class DcRoadConditionInformation extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** $column.columnComment */ |
|||
private Long id; |
|||
|
|||
/** 其他配置 */ |
|||
@Excel(name = "其他配置") |
|||
private String otherConfig; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setOtherConfig(String otherConfig) |
|||
{ |
|||
this.otherConfig = otherConfig; |
|||
} |
|||
|
|||
public String getOtherConfig() |
|||
{ |
|||
return otherConfig; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("otherConfig", getOtherConfig()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.zc.business.mapper; |
|||
|
|||
import com.zc.business.domain.DcRoadConditionInformation; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 路况信息Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-07-02 |
|||
*/ |
|||
public interface DcRoadConditionInformationMapper |
|||
{ |
|||
/** |
|||
* 查询路况信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 路况信息 |
|||
*/ |
|||
public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id); |
|||
|
|||
/** |
|||
* 查询路况信息列表 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 路况信息集合 |
|||
*/ |
|||
List<DcRoadConditionInformation> selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 新增路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 修改路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 删除路况信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcRoadConditionInformationById(Long id); |
|||
|
|||
/** |
|||
* 批量删除路况信息 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcRoadConditionInformationByIds(Long[] ids); |
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.zc.business.service; |
|||
|
|||
import com.zc.business.domain.DcRoadConditionInformation; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 路况信息Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-07-02 |
|||
*/ |
|||
public interface IDcRoadConditionInformationService |
|||
{ |
|||
/** |
|||
* 查询路况信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 路况信息 |
|||
*/ |
|||
public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id); |
|||
|
|||
/** |
|||
* 查询路况信息列表 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 路况信息集合 |
|||
*/ |
|||
List<DcRoadConditionInformation> selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 新增路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 修改路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); |
|||
|
|||
/** |
|||
* 批量删除路况信息 |
|||
* |
|||
* @param ids 需要删除的路况信息主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcRoadConditionInformationByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除路况信息信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcRoadConditionInformationById(Long id); |
|||
} |
@ -0,0 +1,97 @@ |
|||
package com.zc.business.service.impl; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import com.zc.business.domain.DcRoadConditionInformation; |
|||
import com.zc.business.mapper.DcRoadConditionInformationMapper; |
|||
import com.zc.business.service.IDcRoadConditionInformationService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* 路况信息Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-07-02 |
|||
*/ |
|||
@Service |
|||
public class DcRoadConditionInformationServiceImpl implements IDcRoadConditionInformationService |
|||
{ |
|||
@Autowired |
|||
private DcRoadConditionInformationMapper dcRoadConditionInformationMapper; |
|||
|
|||
/** |
|||
* 查询路况信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 路况信息 |
|||
*/ |
|||
@Override |
|||
public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id) |
|||
{ |
|||
return dcRoadConditionInformationMapper.selectDcRoadConditionInformationById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询路况信息列表 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 路况信息 |
|||
*/ |
|||
@Override |
|||
public List<DcRoadConditionInformation> selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
return dcRoadConditionInformationMapper.selectDcRoadConditionInformationList(dcRoadConditionInformation); |
|||
} |
|||
|
|||
/** |
|||
* 新增路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
dcRoadConditionInformation.setCreateTime(DateUtils.getNowDate()); |
|||
return dcRoadConditionInformationMapper.insertDcRoadConditionInformation(dcRoadConditionInformation); |
|||
} |
|||
|
|||
/** |
|||
* 修改路况信息 |
|||
* |
|||
* @param dcRoadConditionInformation 路况信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation) |
|||
{ |
|||
dcRoadConditionInformation.setUpdateTime(DateUtils.getNowDate()); |
|||
return dcRoadConditionInformationMapper.updateDcRoadConditionInformation(dcRoadConditionInformation); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除路况信息 |
|||
* |
|||
* @param ids 需要删除的路况信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteDcRoadConditionInformationByIds(Long[] ids) |
|||
{ |
|||
return dcRoadConditionInformationMapper.deleteDcRoadConditionInformationByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除路况信息信息 |
|||
* |
|||
* @param id 路况信息主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteDcRoadConditionInformationById(Long id) |
|||
{ |
|||
return dcRoadConditionInformationMapper.deleteDcRoadConditionInformationById(id); |
|||
} |
|||
} |
@ -0,0 +1,68 @@ |
|||
<?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.zc.business.mapper.DcRoadConditionInformationMapper"> |
|||
|
|||
<resultMap type="com.zc.business.domain.DcRoadConditionInformation" id="DcRoadConditionInformationResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="otherConfig" column="other_config" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcRoadConditionInformationVo"> |
|||
select id, create_time, update_time, other_config from dc_road_condition_information |
|||
</sql> |
|||
|
|||
<select id="selectDcRoadConditionInformationList" parameterType="DcRoadConditionInformation" resultMap="DcRoadConditionInformationResult"> |
|||
<include refid="selectDcRoadConditionInformationVo"/> |
|||
<where> |
|||
<if test="otherConfig != null and otherConfig != ''"> and other_config = #{otherConfig}</if> |
|||
</where> |
|||
ORDER BY create_time DESC |
|||
|
|||
</select> |
|||
|
|||
<select id="selectDcRoadConditionInformationById" parameterType="Long" resultMap="DcRoadConditionInformationResult"> |
|||
<include refid="selectDcRoadConditionInformationVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertDcRoadConditionInformation" parameterType="DcRoadConditionInformation"> |
|||
insert into dc_road_condition_information |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">id,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
<if test="otherConfig != null">other_config,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">#{id},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="otherConfig != null">#{otherConfig},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateDcRoadConditionInformation" parameterType="DcRoadConditionInformation"> |
|||
update dc_road_condition_information |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="createTime != null">create_time = #{createTime},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
<if test="otherConfig != null">other_config = #{otherConfig},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcRoadConditionInformationById" parameterType="Long"> |
|||
delete from dc_road_condition_information where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcRoadConditionInformationByIds" parameterType="String"> |
|||
delete from dc_road_condition_information where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
Loading…
Reference in new issue