parent
fc919b0241
commit
e0d09a4685
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.business.domain.HwTemplateStyle;
|
||||
import com.ruoyi.business.service.IHwTemplateStyleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 场景化图风格信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/templateStyle")
|
||||
public class HwTemplateStyleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwTemplateStyleService hwTemplateStyleService;
|
||||
|
||||
/**
|
||||
* 查询场景化图风格信息列表
|
||||
*/
|
||||
// @RequiresPermissions("business:templateStyle:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
startPage();
|
||||
List<HwTemplateStyle> list = hwTemplateStyleService.selectHwTemplateStyleList(hwTemplateStyle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出场景化图风格信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:templateStyle:export")
|
||||
@Log(title = "场景化图风格信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
List<HwTemplateStyle> list = hwTemplateStyleService.selectHwTemplateStyleList(hwTemplateStyle);
|
||||
ExcelUtil<HwTemplateStyle> util = new ExcelUtil<HwTemplateStyle>(HwTemplateStyle.class);
|
||||
util.exportExcel(response, list, "场景化图风格信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取场景化图风格信息详细信息
|
||||
*/
|
||||
// @RequiresPermissions("business:templateStyle:query")
|
||||
@GetMapping(value = "/{templateStyleId}")
|
||||
public AjaxResult getInfo(@PathVariable("templateStyleId") Long templateStyleId)
|
||||
{
|
||||
return success(hwTemplateStyleService.selectHwTemplateStyleByTemplateStyleId(templateStyleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景化图风格信息
|
||||
*/
|
||||
// @RequiresPermissions("business:templateStyle:add")
|
||||
@Log(title = "场景化图风格信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
return toAjax(hwTemplateStyleService.insertHwTemplateStyle(hwTemplateStyle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景化图风格信息
|
||||
*/
|
||||
// @RequiresPermissions("business:templateStyle:edit")
|
||||
@Log(title = "场景化图风格信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
return toAjax(hwTemplateStyleService.updateHwTemplateStyle(hwTemplateStyle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景化图风格信息
|
||||
*/
|
||||
@RequiresPermissions("business:templateStyle:remove")
|
||||
@Log(title = "场景化图风格信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{templateStyleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] templateStyleIds)
|
||||
{
|
||||
return toAjax(hwTemplateStyleService.deleteHwTemplateStyleByTemplateStyleIds(templateStyleIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwTemplateStyle;
|
||||
|
||||
/**
|
||||
* 场景化图风格信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface HwTemplateStyleMapper
|
||||
{
|
||||
/**
|
||||
* 查询场景化图风格信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 场景化图风格信息
|
||||
*/
|
||||
public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId);
|
||||
|
||||
/**
|
||||
* 查询场景化图风格信息列表
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 场景化图风格信息集合
|
||||
*/
|
||||
public List<HwTemplateStyle> selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 新增场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 修改场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 删除场景化图风格信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId);
|
||||
|
||||
/**
|
||||
* 批量删除场景化图风格信息
|
||||
*
|
||||
* @param templateStyleIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwTemplateStyle;
|
||||
|
||||
/**
|
||||
* 场景化图风格信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface IHwTemplateStyleService
|
||||
{
|
||||
/**
|
||||
* 查询场景化图风格信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 场景化图风格信息
|
||||
*/
|
||||
public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId);
|
||||
|
||||
/**
|
||||
* 查询场景化图风格信息列表
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 场景化图风格信息集合
|
||||
*/
|
||||
public List<HwTemplateStyle> selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 新增场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 修改场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle);
|
||||
|
||||
/**
|
||||
* 批量删除场景化图风格信息
|
||||
*
|
||||
* @param templateStyleIds 需要删除的场景化图风格信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds);
|
||||
|
||||
/**
|
||||
* 删除场景化图风格信息信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId);
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.HwTemplateStyleMapper;
|
||||
import com.ruoyi.business.domain.HwTemplateStyle;
|
||||
import com.ruoyi.business.service.IHwTemplateStyleService;
|
||||
|
||||
/**
|
||||
* 场景化图风格信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Service
|
||||
public class HwTemplateStyleServiceImpl implements IHwTemplateStyleService
|
||||
{
|
||||
@Autowired
|
||||
private HwTemplateStyleMapper hwTemplateStyleMapper;
|
||||
|
||||
/**
|
||||
* 查询场景化图风格信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 场景化图风格信息
|
||||
*/
|
||||
@Override
|
||||
public HwTemplateStyle selectHwTemplateStyleByTemplateStyleId(Long templateStyleId)
|
||||
{
|
||||
return hwTemplateStyleMapper.selectHwTemplateStyleByTemplateStyleId(templateStyleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场景化图风格信息列表
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 场景化图风格信息
|
||||
*/
|
||||
@Override
|
||||
public List<HwTemplateStyle> selectHwTemplateStyleList(HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
return hwTemplateStyleMapper.selectHwTemplateStyleList(hwTemplateStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwTemplateStyle(HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
hwTemplateStyle.setCreateBy(SecurityUtils.getUsername());
|
||||
hwTemplateStyle.setCreateTime(DateUtils.getNowDate());
|
||||
return hwTemplateStyleMapper.insertHwTemplateStyle(hwTemplateStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景化图风格信息
|
||||
*
|
||||
* @param hwTemplateStyle 场景化图风格信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwTemplateStyle(HwTemplateStyle hwTemplateStyle)
|
||||
{
|
||||
hwTemplateStyle.setUpdateBy(SecurityUtils.getUsername());
|
||||
hwTemplateStyle.setUpdateTime(DateUtils.getNowDate());
|
||||
return hwTemplateStyleMapper.updateHwTemplateStyle(hwTemplateStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场景化图风格信息
|
||||
*
|
||||
* @param templateStyleIds 需要删除的场景化图风格信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwTemplateStyleByTemplateStyleIds(Long[] templateStyleIds)
|
||||
{
|
||||
return hwTemplateStyleMapper.deleteHwTemplateStyleByTemplateStyleIds(templateStyleIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景化图风格信息信息
|
||||
*
|
||||
* @param templateStyleId 场景化图风格信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwTemplateStyleByTemplateStyleId(Long templateStyleId)
|
||||
{
|
||||
return hwTemplateStyleMapper.deleteHwTemplateStyleByTemplateStyleId(templateStyleId);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?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.ruoyi.business.mapper.HwTemplateStyleMapper">
|
||||
|
||||
<resultMap type="HwTemplateStyle" id="HwTemplateStyleResult">
|
||||
<result property="templateStyleId" column="template_style_id" />
|
||||
<result property="templateStyleType" column="template_style_type" />
|
||||
<result property="baseColor" column="base_color" />
|
||||
<result property="fontColor" column="font_color" />
|
||||
<result property="colors" column="colors" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwTemplateStyleVo">
|
||||
select template_style_id, template_style_type, base_color, font_color, colors, create_by, create_time, update_by, update_time from hw_template_style
|
||||
</sql>
|
||||
|
||||
<select id="selectHwTemplateStyleList" parameterType="HwTemplateStyle" resultMap="HwTemplateStyleResult">
|
||||
<include refid="selectHwTemplateStyleVo"/>
|
||||
<where>
|
||||
<if test="templateStyleType != null and templateStyleType != ''"> and template_style_type = #{templateStyleType}</if>
|
||||
<if test="baseColor != null and baseColor != ''"> and base_color = #{baseColor}</if>
|
||||
<if test="fontColor != null and fontColor != ''"> and font_color = #{fontColor}</if>
|
||||
<if test="colors != null and colors != ''"> and colors = #{colors}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwTemplateStyleByTemplateStyleId" parameterType="Long" resultMap="HwTemplateStyleResult">
|
||||
<include refid="selectHwTemplateStyleVo"/>
|
||||
where template_style_id = #{templateStyleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwTemplateStyle" parameterType="HwTemplateStyle" useGeneratedKeys="true" keyProperty="templateStyleId">
|
||||
insert into hw_template_style
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateStyleType != null and templateStyleType != ''">template_style_type,</if>
|
||||
<if test="baseColor != null and baseColor != ''">base_color,</if>
|
||||
<if test="fontColor != null and fontColor != ''">font_color,</if>
|
||||
<if test="colors != null">colors,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateStyleType != null and templateStyleType != ''">#{templateStyleType},</if>
|
||||
<if test="baseColor != null and baseColor != ''">#{baseColor},</if>
|
||||
<if test="fontColor != null and fontColor != ''">#{fontColor},</if>
|
||||
<if test="colors != null">#{colors},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwTemplateStyle" parameterType="HwTemplateStyle">
|
||||
update hw_template_style
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateStyleType != null and templateStyleType != ''">template_style_type = #{templateStyleType},</if>
|
||||
<if test="baseColor != null and baseColor != ''">base_color = #{baseColor},</if>
|
||||
<if test="fontColor != null and fontColor != ''">font_color = #{fontColor},</if>
|
||||
<if test="colors != null">colors = #{colors},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where template_style_id = #{templateStyleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwTemplateStyleByTemplateStyleId" parameterType="Long">
|
||||
delete from hw_template_style where template_style_id = #{templateStyleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwTemplateStyleByTemplateStyleIds" parameterType="String">
|
||||
delete from hw_template_style where template_style_id in
|
||||
<foreach item="templateStyleId" collection="array" open="(" separator="," close=")">
|
||||
#{templateStyleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue