Commit a5bd381a authored by 盖献康's avatar 盖献康

车企信息 - 修改

parent f580eafc
package com.ruoyi.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
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;
......@@ -19,30 +19,36 @@ import com.ruoyi.common.core.domain.BaseEntity;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TAutomobileEnterprise extends BaseEntity
@ApiModel(value = "车企信息对象")
public class AutomobileEnterprise extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@ApiModelProperty("ID")
private Long id;
/** 企业名称 */
@Excel(name = "企业名称")
@ApiModelProperty("企业名称")
private String enterpriseName;
/** 地址 */
@Excel(name = "地址")
@ApiModelProperty("地址")
private String address;
/** 邮编 */
@Excel(name = "邮编")
@ApiModelProperty("邮编")
private String postcode;
/** 企业联系人 */
@Excel(name = "企业联系人")
@ApiModelProperty("企业联系人")
private String enterpriseContact;
/** 联系电话 */
@Excel(name = "联系电话")
@ApiModelProperty("联系电话")
private String contactNumber;
}
package com.ruoyi.mapper;
import java.util.List;
import com.ruoyi.domain.TAutomobileEnterprise;
import com.ruoyi.domain.AutomobileEnterprise;
/**
* 车企信息Mapper接口
*
*
* @author gxk
* @date 2024-01-05
*/
public interface TAutomobileEnterpriseMapper
public interface AutomobileEnterpriseMapper
{
/**
* 查询车企信息
*
*
* @param id 车企信息主键
* @return 车企信息
*/
public TAutomobileEnterprise selectTAutomobileEnterpriseById(Long id);
public AutomobileEnterprise selectAutomobileEnterpriseById(Long id);
/**
* 查询车企信息列表
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 车企信息集合
*/
public List<TAutomobileEnterprise> selectTAutomobileEnterpriseList(TAutomobileEnterprise tAutomobileEnterprise);
public List<AutomobileEnterprise> selectAutomobileEnterpriseList(AutomobileEnterprise automobileEnterprise);
/**
* 新增车企信息
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 结果
*/
public int insertTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise);
public int insertAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 修改车企信息
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 结果
*/
public int updateTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise);
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 删除车企信息
*
*
* @param id 车企信息主键
* @return 结果
*/
public int deleteTAutomobileEnterpriseById(Long id);
public int deleteAutomobileEnterpriseById(Long id);
/**
* 批量删除车企信息
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteTAutomobileEnterpriseByIds(Long[] ids);
public int deleteAutomobileEnterpriseByIds(Long[] ids);
}
package com.ruoyi.service;
import java.util.List;
import com.ruoyi.domain.TAutomobileEnterprise;
import com.ruoyi.domain.AutomobileEnterprise;
import org.apache.ibatis.annotations.Mapper;
/**
* 车企信息Service接口
*
*
* @author gxk
* @date 2024-01-05
*/
public interface ITAutomobileEnterpriseService
@Mapper
public interface IAutomobileEnterpriseService
{
/**
* 查询车企信息
*
*
* @param id 车企信息主键
* @return 车企信息
*/
public TAutomobileEnterprise selectTAutomobileEnterpriseById(Long id);
public AutomobileEnterprise selectAutomobileEnterpriseById(Long id);
/**
* 查询车企信息列表
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 车企信息集合
*/
public List<TAutomobileEnterprise> selectTAutomobileEnterpriseList(TAutomobileEnterprise tAutomobileEnterprise);
public List<AutomobileEnterprise> selectAutomobileEnterpriseList(AutomobileEnterprise automobileEnterprise);
/**
* 新增车企信息
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 结果
*/
public int insertTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise);
public int insertAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 修改车企信息
*
* @param tAutomobileEnterprise 车企信息
*
* @param automobileEnterprise 车企信息
* @return 结果
*/
public int updateTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise);
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise);
/**
* 批量删除车企信息
*
*
* @param ids 需要删除的车企信息主键集合
* @return 结果
*/
public int deleteTAutomobileEnterpriseByIds(Long[] ids);
public int deleteAutomobileEnterpriseByIds(Long[] ids);
/**
* 删除车企信息信息
*
*
* @param id 车企信息主键
* @return 结果
*/
public int deleteTAutomobileEnterpriseById(Long id);
public int deleteAutomobileEnterpriseById(Long id);
}
......@@ -5,9 +5,9 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.TAutomobileEnterpriseMapper;
import com.ruoyi.domain.TAutomobileEnterprise;
import com.ruoyi.service.ITAutomobileEnterpriseService;
import com.ruoyi.mapper.AutomobileEnterpriseMapper;
import com.ruoyi.domain.AutomobileEnterprise;
import com.ruoyi.service.IAutomobileEnterpriseService;
/**
* 车企信息Service业务层处理
......@@ -16,10 +16,10 @@ import com.ruoyi.service.ITAutomobileEnterpriseService;
* @date 2024-01-05
*/
@Service
public class TAutomobileEnterpriseServiceImpl implements ITAutomobileEnterpriseService
public class AutomobileEnterpriseServiceImpl implements IAutomobileEnterpriseService
{
@Autowired
private TAutomobileEnterpriseMapper tAutomobileEnterpriseMapper;
private AutomobileEnterpriseMapper automobileEnterpriseMapper;
/**
* 查询车企信息
......@@ -28,49 +28,49 @@ public class TAutomobileEnterpriseServiceImpl implements ITAutomobileEnterpriseS
* @return 车企信息
*/
@Override
public TAutomobileEnterprise selectTAutomobileEnterpriseById(Long id)
public AutomobileEnterprise selectAutomobileEnterpriseById(Long id)
{
return tAutomobileEnterpriseMapper.selectTAutomobileEnterpriseById(id);
return automobileEnterpriseMapper.selectAutomobileEnterpriseById(id);
}
/**
* 查询车企信息列表
*
* @param tAutomobileEnterprise 车企信息
* @param automobileEnterprise 车企信息
* @return 车企信息
*/
@Override
public List<TAutomobileEnterprise> selectTAutomobileEnterpriseList(TAutomobileEnterprise tAutomobileEnterprise)
public List<AutomobileEnterprise> selectAutomobileEnterpriseList(AutomobileEnterprise automobileEnterprise)
{
return tAutomobileEnterpriseMapper.selectTAutomobileEnterpriseList(tAutomobileEnterprise);
return automobileEnterpriseMapper.selectAutomobileEnterpriseList(automobileEnterprise);
}
/**
* 新增车企信息
*
* @param tAutomobileEnterprise 车企信息
* @param automobileEnterprise 车企信息
* @return 结果
*/
@Override
public int insertTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise)
public int insertAutomobileEnterprise(AutomobileEnterprise automobileEnterprise)
{
tAutomobileEnterprise.setCreateTime(DateUtils.getNowDate());
tAutomobileEnterprise.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
return tAutomobileEnterpriseMapper.insertTAutomobileEnterprise(tAutomobileEnterprise);
automobileEnterprise.setCreateTime(DateUtils.getNowDate());
automobileEnterprise.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
return automobileEnterpriseMapper.insertAutomobileEnterprise(automobileEnterprise);
}
/**
* 修改车企信息
*
* @param tAutomobileEnterprise 车企信息
* @param automobileEnterprise 车企信息
* @return 结果
*/
@Override
public int updateTAutomobileEnterprise(TAutomobileEnterprise tAutomobileEnterprise)
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise)
{
tAutomobileEnterprise.setUpdateTime(DateUtils.getNowDate());
tAutomobileEnterprise.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
return tAutomobileEnterpriseMapper.updateTAutomobileEnterprise(tAutomobileEnterprise);
automobileEnterprise.setUpdateTime(DateUtils.getNowDate());
automobileEnterprise.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
return automobileEnterpriseMapper.updateAutomobileEnterprise(automobileEnterprise);
}
/**
......@@ -80,9 +80,9 @@ public class TAutomobileEnterpriseServiceImpl implements ITAutomobileEnterpriseS
* @return 结果
*/
@Override
public int deleteTAutomobileEnterpriseByIds(Long[] ids)
public int deleteAutomobileEnterpriseByIds(Long[] ids)
{
return tAutomobileEnterpriseMapper.deleteTAutomobileEnterpriseByIds(ids);
return automobileEnterpriseMapper.deleteAutomobileEnterpriseByIds(ids);
}
/**
......@@ -92,8 +92,8 @@ public class TAutomobileEnterpriseServiceImpl implements ITAutomobileEnterpriseS
* @return 结果
*/
@Override
public int deleteTAutomobileEnterpriseById(Long id)
public int deleteAutomobileEnterpriseById(Long id)
{
return tAutomobileEnterpriseMapper.deleteTAutomobileEnterpriseById(id);
return automobileEnterpriseMapper.deleteAutomobileEnterpriseById(id);
}
}
......@@ -4,8 +4,11 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Anonymous;
import org.springframework.security.access.prepost.PreAuthorize;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
......@@ -18,8 +21,8 @@ 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.domain.TAutomobileEnterprise;
import com.ruoyi.service.ITAutomobileEnterpriseService;
import com.ruoyi.domain.AutomobileEnterprise;
import com.ruoyi.service.IAutomobileEnterpriseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
......@@ -29,22 +32,23 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author gxk
* @date 2024-01-05
*/
@Api(tags = {"车企信息"})
@RestController
@RequestMapping("/system/enterprise")
public class TAutomobileEnterpriseController extends BaseController
public class AutomobileEnterpriseController extends BaseController
{
@Autowired
private ITAutomobileEnterpriseService tAutomobileEnterpriseService;
private IAutomobileEnterpriseService automobileEnterpriseService;
/**
* 查询车企信息列表
*/
@Anonymous
@ApiOperation("分页查询车企信息列表")
@GetMapping("/list")
public TableDataInfo list(TAutomobileEnterprise tAutomobileEnterprise)
public TableDataInfo list(AutomobileEnterprise automobileEnterprise)
{
startPage();
List<TAutomobileEnterprise> list = tAutomobileEnterpriseService.selectTAutomobileEnterpriseList(tAutomobileEnterprise);
List<AutomobileEnterprise> list = automobileEnterpriseService.selectAutomobileEnterpriseList(automobileEnterprise);
return getDataTable(list);
}
......@@ -52,51 +56,55 @@ public class TAutomobileEnterpriseController extends BaseController
* 导出车企信息列表
*/
@Log(title = "车企信息", businessType = BusinessType.EXPORT)
@ApiOperation("导出车企信息列表")
@PostMapping("/export")
public void export(HttpServletResponse response, TAutomobileEnterprise tAutomobileEnterprise)
public void export(HttpServletResponse response, AutomobileEnterprise automobileEnterprise)
{
List<TAutomobileEnterprise> list = tAutomobileEnterpriseService.selectTAutomobileEnterpriseList(tAutomobileEnterprise);
ExcelUtil<TAutomobileEnterprise> util = new ExcelUtil<TAutomobileEnterprise>(TAutomobileEnterprise.class);
List<AutomobileEnterprise> list = automobileEnterpriseService.selectAutomobileEnterpriseList(automobileEnterprise);
ExcelUtil<AutomobileEnterprise> util = new ExcelUtil<AutomobileEnterprise>(AutomobileEnterprise.class);
util.exportExcel(response, list, "车企信息数据");
}
/**
* 获取车企信息详细信息
*/
@ApiOperation("获取车企信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
public R getInfo(@PathVariable("id") Long id)
{
return success(tAutomobileEnterpriseService.selectTAutomobileEnterpriseById(id));
return R.ok(automobileEnterpriseService.selectAutomobileEnterpriseById(id));
}
/**
* 新增车企信息
*/
@Anonymous
@ApiOperation("新增车企信息")
@Log(title = "车企信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAutomobileEnterprise tAutomobileEnterprise)
public R add(@RequestBody AutomobileEnterprise automobileEnterprise)
{
return toAjax(tAutomobileEnterpriseService.insertTAutomobileEnterprise(tAutomobileEnterprise));
return R.ok(automobileEnterpriseService.insertAutomobileEnterprise(automobileEnterprise));
}
/**
* 修改车企信息
*/
@ApiOperation("修改车企信息")
@Log(title = "车企信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAutomobileEnterprise tAutomobileEnterprise)
public R edit(@RequestBody AutomobileEnterprise automobileEnterprise)
{
return toAjax(tAutomobileEnterpriseService.updateTAutomobileEnterprise(tAutomobileEnterprise));
return R.ok(automobileEnterpriseService.updateAutomobileEnterprise(automobileEnterprise));
}
/**
* 删除车企信息
*/
@ApiOperation("删除车企信息")
@Log(title = "车企信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
public R remove(@PathVariable Long[] ids)
{
return toAjax(tAutomobileEnterpriseService.deleteTAutomobileEnterpriseByIds(ids));
return R.ok(automobileEnterpriseService.deleteAutomobileEnterpriseByIds(ids));
}
}
......@@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.TAutomobileEnterpriseMapper">
<mapper namespace="com.ruoyi.mapper.AutomobileEnterpriseMapper">
<resultMap type="com.ruoyi.domain.TAutomobileEnterprise" id="TAutomobileEnterpriseResult">
<resultMap type="com.ruoyi.domain.AutomobileEnterprise" id="AutomobileEnterpriseResult">
<result property="id" column="id"/>
<result property="enterpriseName" column="enterprise_name"/>
<result property="address" column="address"/>
......@@ -17,7 +17,7 @@
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectTAutomobileEnterpriseVo">
<sql id="selectAutomobileEnterpriseVo">
select id,
enterprise_name,
address,
......@@ -31,9 +31,9 @@
from t_automobile_enterprise
</sql>
<select id="selectTAutomobileEnterpriseList" parameterType="TAutomobileEnterprise"
resultMap="TAutomobileEnterpriseResult">
<include refid="selectTAutomobileEnterpriseVo"/>
<select id="selectAutomobileEnterpriseList" parameterType="com.ruoyi.domain.AutomobileEnterprise"
resultMap="AutomobileEnterpriseResult">
<include refid="selectAutomobileEnterpriseVo"/>
<where>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name like concat('%',
#{enterpriseName}, '%')
......@@ -47,12 +47,12 @@
</where>
</select>
<select id="selectTAutomobileEnterpriseById" parameterType="Long" resultMap="TAutomobileEnterpriseResult">
<include refid="selectTAutomobileEnterpriseVo"/>
<select id="selectAutomobileEnterpriseById" parameterType="Long" resultMap="AutomobileEnterpriseResult">
<include refid="selectAutomobileEnterpriseVo"/>
where id = #{id}
</select>
<insert id="insertTAutomobileEnterprise" parameterType="TAutomobileEnterprise">
<insert id="insertAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise">
insert into t_automobile_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
......@@ -80,7 +80,7 @@
</trim>
</insert>
<update id="updateTAutomobileEnterprise" parameterType="TAutomobileEnterprise">
<update id="updateAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise">
update t_automobile_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
......@@ -96,13 +96,13 @@
where id = #{id}
</update>
<delete id="deleteTAutomobileEnterpriseById" parameterType="Long">
<delete id="deleteAutomobileEnterpriseById" parameterType="Long">
delete
from t_automobile_enterprise
where id = #{id}
</delete>
<delete id="deleteTAutomobileEnterpriseByIds" parameterType="String">
<delete id="deleteAutomobileEnterpriseByIds" parameterType="String">
delete from t_automobile_enterprise where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment