| ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyUserController.java | ●●●●● patch | view | raw | blame | history | |
| ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyUser.java | ●●●●● patch | view | raw | blame | history | |
| ard-work/src/main/java/com/ruoyi/sy/mapper/ArdSyUserMapper.java | ●●●●● patch | view | raw | blame | history | |
| ard-work/src/main/java/com/ruoyi/sy/service/IArdSyUserService.java | ●●●●● patch | view | raw | blame | history | |
| ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyUserServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
| ard-work/src/main/resources/mapper/sy/ArdSyUserMapper.xml | ●●●●● patch | view | raw | blame | history |
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyUserController.java
New file @@ -0,0 +1,104 @@ package com.ruoyi.sy.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.sy.domain.ArdSyUser; import com.ruoyi.sy.service.IArdSyUserService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 三一车辆用户Controller * * @author ard * @date 2023-06-24 */ @RestController @RequestMapping("/sy/syUser") public class ArdSyUserController extends BaseController { @Autowired private IArdSyUserService ardSyUserService; /** * 查询三一车辆用户列表 */ @PreAuthorize("@ss.hasPermi('sy:syUser:list')") @GetMapping("/list") public TableDataInfo list(ArdSyUser ardSyUser) { startPage(); List<ArdSyUser> list = ardSyUserService.selectArdSyUserList(ardSyUser); return getDataTable(list); } /** * 导出三一车辆用户列表 */ @PreAuthorize("@ss.hasPermi('sy:syUser:export')") @Log(title = "三一车辆用户", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdSyUser ardSyUser) { List<ArdSyUser> list = ardSyUserService.selectArdSyUserList(ardSyUser); ExcelUtil<ArdSyUser> util = new ExcelUtil<ArdSyUser>(ArdSyUser.class); util.exportExcel(response, list, "三一车辆用户数据"); } /** * 获取三一车辆用户详细信息 */ @PreAuthorize("@ss.hasPermi('sy:syUser:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardSyUserService.selectArdSyUserById(id)); } /** * 新增三一车辆用户 */ @PreAuthorize("@ss.hasPermi('sy:syUser:add')") @Log(title = "三一车辆用户", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdSyUser ardSyUser) { return toAjax(ardSyUserService.insertArdSyUser(ardSyUser)); } /** * 修改三一车辆用户 */ @PreAuthorize("@ss.hasPermi('sy:syUser:edit')") @Log(title = "三一车辆用户", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdSyUser ardSyUser) { return toAjax(ardSyUserService.updateArdSyUser(ardSyUser)); } /** * 删除三一车辆用户 */ @PreAuthorize("@ss.hasPermi('sy:syUser:remove')") @Log(title = "三一车辆用户", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardSyUserService.deleteArdSyUserByIds(ids)); } } ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyUser.java
New file @@ -0,0 +1,107 @@ package com.ruoyi.sy.domain; 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; /** * 三一车辆用户对象 ard_sy_user * * @author ard * @date 2023-06-24 */ public class ArdSyUser extends BaseEntity { private static final long serialVersionUID = 1L; /** 主键 */ private String id; /** 用户主键 */ @Excel(name = "用户主键") private String sysUserId; /** 三一用户账号 */ @Excel(name = "三一用户账号") private String userId; /** 三一用户密码 */ @Excel(name = "三一用户密码") private String password; /** 预留1 */ @Excel(name = "预留1") private String reserved1; /** 预留2 */ @Excel(name = "预留2") private String reserved2; public void setId(String id) { this.id = id; } public String getId() { return id; } public void setSysUserId(String sysUserId) { this.sysUserId = sysUserId; } public String getSysUserId() { return sysUserId; } public void setUserId(String userId) { this.userId = userId; } public String getUserId() { return userId; } public void setPassword(String password) { this.password = password; } public String getPassword() { return password; } public void setReserved1(String reserved1) { this.reserved1 = reserved1; } public String getReserved1() { return reserved1; } public void setReserved2(String reserved2) { this.reserved2 = reserved2; } public String getReserved2() { return reserved2; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("sysUserId", getSysUserId()) .append("userId", getUserId()) .append("password", getPassword()) .append("reserved1", getReserved1()) .append("reserved2", getReserved2()) .toString(); } } ard-work/src/main/java/com/ruoyi/sy/mapper/ArdSyUserMapper.java
New file @@ -0,0 +1,61 @@ package com.ruoyi.sy.mapper; import java.util.List; import com.ruoyi.sy.domain.ArdSyUser; /** * 三一车辆用户Mapper接口 * * @author ard * @date 2023-06-24 */ public interface ArdSyUserMapper { /** * 查询三一车辆用户 * * @param id 三一车辆用户主键 * @return 三一车辆用户 */ public ArdSyUser selectArdSyUserById(String id); /** * 查询三一车辆用户列表 * * @param ardSyUser 三一车辆用户 * @return 三一车辆用户集合 */ public List<ArdSyUser> selectArdSyUserList(ArdSyUser ardSyUser); /** * 新增三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ public int insertArdSyUser(ArdSyUser ardSyUser); /** * 修改三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ public int updateArdSyUser(ArdSyUser ardSyUser); /** * 删除三一车辆用户 * * @param id 三一车辆用户主键 * @return 结果 */ public int deleteArdSyUserById(String id); /** * 批量删除三一车辆用户 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteArdSyUserByIds(String[] ids); } ard-work/src/main/java/com/ruoyi/sy/service/IArdSyUserService.java
New file @@ -0,0 +1,61 @@ package com.ruoyi.sy.service; import java.util.List; import com.ruoyi.sy.domain.ArdSyUser; /** * 三一车辆用户Service接口 * * @author ard * @date 2023-06-24 */ public interface IArdSyUserService { /** * 查询三一车辆用户 * * @param id 三一车辆用户主键 * @return 三一车辆用户 */ public ArdSyUser selectArdSyUserById(String id); /** * 查询三一车辆用户列表 * * @param ardSyUser 三一车辆用户 * @return 三一车辆用户集合 */ public List<ArdSyUser> selectArdSyUserList(ArdSyUser ardSyUser); /** * 新增三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ public int insertArdSyUser(ArdSyUser ardSyUser); /** * 修改三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ public int updateArdSyUser(ArdSyUser ardSyUser); /** * 批量删除三一车辆用户 * * @param ids 需要删除的三一车辆用户主键集合 * @return 结果 */ public int deleteArdSyUserByIds(String[] ids); /** * 删除三一车辆用户信息 * * @param id 三一车辆用户主键 * @return 结果 */ public int deleteArdSyUserById(String id); } ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyUserServiceImpl.java
New file @@ -0,0 +1,91 @@ package com.ruoyi.sy.service.impl; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.sy.mapper.ArdSyUserMapper; import com.ruoyi.sy.domain.ArdSyUser; import com.ruoyi.sy.service.IArdSyUserService; import javax.annotation.Resource; /** * 三一车辆用户Service业务层处理 * * @author ard * @date 2023-06-24 */ @Service public class ArdSyUserServiceImpl implements IArdSyUserService { @Resource private ArdSyUserMapper ardSyUserMapper; /** * 查询三一车辆用户 * * @param id 三一车辆用户主键 * @return 三一车辆用户 */ @Override public ArdSyUser selectArdSyUserById(String id) { return ardSyUserMapper.selectArdSyUserById(id); } /** * 查询三一车辆用户列表 * * @param ardSyUser 三一车辆用户 * @return 三一车辆用户 */ @Override public List<ArdSyUser> selectArdSyUserList(ArdSyUser ardSyUser) { return ardSyUserMapper.selectArdSyUserList(ardSyUser); } /** * 新增三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ @Override public int insertArdSyUser(ArdSyUser ardSyUser) { ardSyUser.setUserId(SecurityUtils.getUserId()); return ardSyUserMapper.insertArdSyUser(ardSyUser); } /** * 修改三一车辆用户 * * @param ardSyUser 三一车辆用户 * @return 结果 */ @Override public int updateArdSyUser(ArdSyUser ardSyUser) { return ardSyUserMapper.updateArdSyUser(ardSyUser); } /** * 批量删除三一车辆用户 * * @param ids 需要删除的三一车辆用户主键 * @return 结果 */ @Override public int deleteArdSyUserByIds(String[] ids) { return ardSyUserMapper.deleteArdSyUserByIds(ids); } /** * 删除三一车辆用户信息 * * @param id 三一车辆用户主键 * @return 结果 */ @Override public int deleteArdSyUserById(String id) { return ardSyUserMapper.deleteArdSyUserById(id); } } ard-work/src/main/resources/mapper/sy/ArdSyUserMapper.xml
New file @@ -0,0 +1,78 @@ <?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.sy.mapper.ArdSyUserMapper"> <resultMap type="ArdSyUser" id="ArdSyUserResult"> <result property="id" column="id" /> <result property="sysUserId" column="sys_user_id" /> <result property="userId" column="user_id" /> <result property="password" column="password" /> <result property="reserved1" column="reserved_1" /> <result property="reserved2" column="reserved_2" /> </resultMap> <sql id="selectArdSyUserVo"> select id, sys_user_id, user_id, password, reserved_1, reserved_2 from ard_sy_user </sql> <select id="selectArdSyUserList" parameterType="ArdSyUser" resultMap="ArdSyUserResult"> <include refid="selectArdSyUserVo"/> <where> <if test="sysUserId != null and sysUserId != ''"> and sys_user_id = #{sysUserId}</if> <if test="userId != null and userId != ''"> and user_id = #{userId}</if> <if test="password != null and password != ''"> and password = #{password}</if> <if test="reserved1 != null and reserved1 != ''"> and reserved_1 = #{reserved1}</if> <if test="reserved2 != null and reserved2 != ''"> and reserved_2 = #{reserved2}</if> </where> </select> <select id="selectArdSyUserById" parameterType="String" resultMap="ArdSyUserResult"> <include refid="selectArdSyUserVo"/> where id = #{id} </select> <insert id="insertArdSyUser" parameterType="ArdSyUser"> insert into ard_sy_user <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="sysUserId != null">sys_user_id,</if> <if test="userId != null">user_id,</if> <if test="password != null">password,</if> <if test="reserved1 != null">reserved_1,</if> <if test="reserved2 != null">reserved_2,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="sysUserId != null">#{sysUserId},</if> <if test="userId != null">#{userId},</if> <if test="password != null">#{password},</if> <if test="reserved1 != null">#{reserved1},</if> <if test="reserved2 != null">#{reserved2},</if> </trim> </insert> <update id="updateArdSyUser" parameterType="ArdSyUser"> update ard_sy_user <trim prefix="SET" suffixOverrides=","> <if test="sysUserId != null">sys_user_id = #{sysUserId},</if> <if test="userId != null">user_id = #{userId},</if> <if test="password != null">password = #{password},</if> <if test="reserved1 != null">reserved_1 = #{reserved1},</if> <if test="reserved2 != null">reserved_2 = #{reserved2},</if> </trim> where id = #{id} </update> <delete id="deleteArdSyUserById" parameterType="String"> delete from ard_sy_user where id = #{id} </delete> <delete id="deleteArdSyUserByIds" parameterType="String"> delete from ard_sy_user where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>