parent
f3e1e4da53
commit
3c5ae36321
@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.gysl.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.gysl.entity.Fmqd;
|
||||||
|
import com.ruoyi.gysl.service.FmqdService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负面清单管理(FmqdController)表控制层
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Api(tags ="负面清单管理" )
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/gysl/Fmqd")
|
||||||
|
public class FmqdController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FmqdService fmqdService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询负面清单数据
|
||||||
|
*
|
||||||
|
* @param fmqd 查询条件实体
|
||||||
|
* @return 分页数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("分页查询负面清单数据")
|
||||||
|
public TableDataInfo list(Fmqd fmqd) {
|
||||||
|
startPage(); // 开启分页
|
||||||
|
List<Fmqd> list = fmqdService.selectFmqdList(fmqd);
|
||||||
|
return getDataTable(list);
|
||||||
|
// 封装分页结果
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通过主键查询单条数据
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 单条数据
|
||||||
|
*/
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("通过主键查询负面清单数据")
|
||||||
|
public AjaxResult select(@PathVariable Integer id){
|
||||||
|
return success(fmqdService.selectFmqdId(id));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*@param fmqd 实体对象
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增数据")
|
||||||
|
public AjaxResult add(@RequestBody Fmqd fmqd) {
|
||||||
|
return success(fmqdService.save(fmqd));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*
|
||||||
|
* @param fmqd 实体对象
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ApiOperation("修改数据")
|
||||||
|
public AjaxResult update(@RequestBody Fmqd fmqd) {
|
||||||
|
return success(fmqdService.updateById(fmqd));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除数据
|
||||||
|
*
|
||||||
|
* @param id 实体对象
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@ApiOperation("删除数据")
|
||||||
|
public AjaxResult delete(@PathVariable Integer id) {
|
||||||
|
return success(fmqdService.deleteMapping(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.gysl.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.gysl.entity.Fmqd;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 负面清单管理(Fmqd)表数据库访问层
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FmqdServiceMapper {
|
||||||
|
/**
|
||||||
|
* 根据条件查询负面清单数据列表
|
||||||
|
*
|
||||||
|
* @param fmqd 查询条件实体
|
||||||
|
* @return 负面清单数据列表
|
||||||
|
*/
|
||||||
|
List<Fmqd> selectFmqdList(Fmqd fmqd);
|
||||||
|
/**
|
||||||
|
* 根据条件查询负面清单的单条数据列表
|
||||||
|
*
|
||||||
|
* @param id 查询条件实体
|
||||||
|
* @return 负面清单单条数据
|
||||||
|
*/
|
||||||
|
Fmqd selectFmqdById(@Param("id") Integer id);
|
||||||
|
/**
|
||||||
|
* 添加负面清单的单条数据
|
||||||
|
*
|
||||||
|
* @param fmqd 添加数据
|
||||||
|
* @return 添加结果
|
||||||
|
*/
|
||||||
|
int saveFmqd(Fmqd fmqd);
|
||||||
|
/**
|
||||||
|
* 修改负面清单的单条数据
|
||||||
|
*
|
||||||
|
* @param fmqd 修改数据
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
int updateFmqd(Fmqd fmqd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改负面清单的单条数据
|
||||||
|
*
|
||||||
|
* @param id 删除数据
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
int deleteFmqd(Integer id);
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.ruoyi.gysl.service;
|
||||||
|
|
||||||
|
import com.ruoyi.gysl.entity.Fmqd;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负面清单管理(FmqdController)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author User
|
||||||
|
*/
|
||||||
|
public interface FmqdService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询负面清单数据列表
|
||||||
|
*
|
||||||
|
* @param fmqd 查询条件实体
|
||||||
|
* @return 负面清单数据列表
|
||||||
|
*/
|
||||||
|
public List<Fmqd> selectFmqdList(Fmqd fmqd);
|
||||||
|
/**
|
||||||
|
* 根据条件查询负面清单的单条数据列表
|
||||||
|
*
|
||||||
|
* @param id 查询条件实体
|
||||||
|
* @return 单条数据
|
||||||
|
*/
|
||||||
|
public Fmqd selectFmqdId(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加负面清单
|
||||||
|
*
|
||||||
|
* @param fmqd 数据
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
public int save(Fmqd fmqd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改负面清单数据
|
||||||
|
*
|
||||||
|
* @param fmqd 数据
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
public int updateById (Fmqd fmqd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除负面清单数据
|
||||||
|
* @param id 数据
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
int deleteMapping(Integer id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.ruoyi.gysl.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.gysl.entity.Fmqd;
|
||||||
|
import com.ruoyi.gysl.mapper.FmqdServiceMapper;
|
||||||
|
import com.ruoyi.gysl.service.FmqdService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*负面清单管理 服务层实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FmqdServiceImpl implements FmqdService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FmqdServiceMapper fmqdMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询负面清单信息
|
||||||
|
*
|
||||||
|
* @param fmqd 查询条件实体
|
||||||
|
* @return 负面清单数据列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Fmqd> selectFmqdList(Fmqd fmqd) {
|
||||||
|
return fmqdMapper.selectFmqdList(fmqd);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询负面清单单条信息
|
||||||
|
*
|
||||||
|
* @param id 查询条件
|
||||||
|
* @return 负面清单单条数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Fmqd selectFmqdId(Integer id) {
|
||||||
|
return fmqdMapper.selectFmqdById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加负面清单信息
|
||||||
|
*
|
||||||
|
* @param fmqd 添加信息
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int save(Fmqd fmqd) {
|
||||||
|
return fmqdMapper.saveFmqd(fmqd);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 添加负面清单信息
|
||||||
|
*
|
||||||
|
* @param fmqd 修改信息
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateById(Fmqd fmqd) {
|
||||||
|
return fmqdMapper.updateFmqd(fmqd);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 添加负面清单信息
|
||||||
|
*
|
||||||
|
* @param id 删除
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMapping(Integer id) {
|
||||||
|
return fmqdMapper.deleteFmqd(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,141 @@
|
|||||||
|
<?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.gysl.mapper.FmqdServiceMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectFmqdList" resultType="com.ruoyi.gysl.entity.Fmqd">
|
||||||
|
SELECT * FROM fmqd
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND name = #{name}
|
||||||
|
</if>
|
||||||
|
<if test="xzfl != null">
|
||||||
|
AND xzfl = #{xzfl}
|
||||||
|
</if>
|
||||||
|
<if test="xmfrdw != null and xmfrdw != ''">
|
||||||
|
AND xmfrdw = #{xmfrdw}
|
||||||
|
</if>
|
||||||
|
<if test="xmjsqzsj != null and xmjsqzsj != ''">
|
||||||
|
AND xmjsqzsj = #{xmjsqzsj}
|
||||||
|
</if>
|
||||||
|
<if test="ztze != null">
|
||||||
|
AND ztze = #{ztze}
|
||||||
|
</if>
|
||||||
|
<if test="zydmj != null">
|
||||||
|
AND zydmj = #{zydmj}
|
||||||
|
</if>
|
||||||
|
<if test="createId != null">
|
||||||
|
AND create_id = #{createId}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
AND create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
AND create_by = #{createBy}
|
||||||
|
</if>
|
||||||
|
<if test="updateId != null">
|
||||||
|
AND update_id = #{updateId}
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">
|
||||||
|
AND update_by = #{updateBy}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
AND update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFmqdById" parameterType="java.lang.Integer" resultType="com.ruoyi.gysl.entity.Fmqd">
|
||||||
|
SELECT * FROM fmqd
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
<!--
|
||||||
|
insert id="saveFmqd" parameterType="com.ruoyi.gysl.entity.Fmqd" useGeneratedKeys="true" keyProperty="id"
|
||||||
|
不知道用不用自主增键
|
||||||
|
-->
|
||||||
|
<insert id="saveFmqd" parameterType="com.ruoyi.gysl.entity.Fmqd" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO fmqd (
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">name,</if>
|
||||||
|
<if test="xzfl != null">xzfl,</if>
|
||||||
|
<if test="xmfrdw != null and xmfrdw != ''">xmfrdw,</if>
|
||||||
|
<if test="xmjsqzsj != null and xmjsqzsj != ''">xmjsqzsj,</if>
|
||||||
|
<if test="ztze != null">ztze,</if>
|
||||||
|
<if test="zydmj != null">zydmj,</if>
|
||||||
|
<if test="createId != null">create_id,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="updateId != null">update_id,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time</if>
|
||||||
|
</trim>
|
||||||
|
) VALUES (
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
|
<if test="xzfl != null">#{xzfl},</if>
|
||||||
|
<if test="xmfrdw != null and xmfrdw != ''">#{xmfrdw},</if>
|
||||||
|
<if test="xmjsqzsj != null and xmjsqzsj != ''">#{xmjsqzsj},</if>
|
||||||
|
<if test="ztze != null">#{ztze},</if>
|
||||||
|
<if test="zydmj != null">#{zydmj},</if>
|
||||||
|
<if test="createId != null">#{createId},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="updateId != null">#{updateId},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime}</if>
|
||||||
|
</trim>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateFmqd" parameterType="com.ruoyi.gysl.entity.Fmqd">
|
||||||
|
UPDATE fmqd
|
||||||
|
<set>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
name = #{name},
|
||||||
|
</if>
|
||||||
|
<if test="xzfl != null">
|
||||||
|
xzfl = #{xzfl},
|
||||||
|
</if>
|
||||||
|
<if test="xmfrdw != null and xmfrdw != ''">
|
||||||
|
xmfrdw = #{xmfrdw},
|
||||||
|
</if>
|
||||||
|
<if test="xmjsqzsj != null and xmjsqzsj != ''">
|
||||||
|
xmjsqzsj = #{xmjsqzsj},
|
||||||
|
</if>
|
||||||
|
<if test="ztze != null">
|
||||||
|
ztze = #{ztze},
|
||||||
|
</if>
|
||||||
|
<if test="zydmj != null">
|
||||||
|
zydmj = #{zydmj},
|
||||||
|
</if>
|
||||||
|
<if test="createId != null">
|
||||||
|
create_id = #{createId},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
create_by = #{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateId != null">
|
||||||
|
update_id = #{updateId},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">
|
||||||
|
update_by = #{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteFmqd" parameterType="Integer">
|
||||||
|
DELETE FROM fmqd WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue