完成卡客户端用户增删改功能,查暂时条件没加
This commit is contained in:
parent
be90bec557
commit
bdd9789374
@ -1,6 +1,7 @@
|
||||
package com.xhpc.card.controller;
|
||||
|
||||
import com.xhpc.card.domain.*;
|
||||
import com.xhpc.card.pojo.TIccardClientUsers;
|
||||
import com.xhpc.card.service.IXhpcCardService;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
@ -201,5 +202,58 @@ public class XhpcCardController extends BaseController {
|
||||
return xhpcCardService.removeBinding(cardRecordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query client users
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/16 10:10
|
||||
* @since version-1.0
|
||||
*/
|
||||
@GetMapping("/card/client/user")
|
||||
public R<Object> queryClientUsers(queryClientUsersCondition queryCondition) {
|
||||
|
||||
return xhpcCardService.queryClientUsers(queryCondition);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a client user
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:36
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PostMapping("/card/client/user")
|
||||
public R<Object> addClientUser(@RequestBody TIccardClientUsers userInfo) {
|
||||
|
||||
return xhpcCardService.addClientUser(userInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* update client user info
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:20
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PatchMapping("/card/client/user")
|
||||
public R<Object> updateClientUserInfo(@RequestBody TIccardClientUsers userInfo) {
|
||||
|
||||
return xhpcCardService.updateClientUser(userInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* update client user info
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:36
|
||||
* @since version-1.0
|
||||
*/
|
||||
@DeleteMapping("/card/client/user")
|
||||
public R<Object> deleteClientUser(Integer userId) {
|
||||
|
||||
return xhpcCardService.deleteClientUser(userId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.xhpc.card.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 条件集合
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 18:15
|
||||
* @since version-1.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class queryClientUsersCondition {
|
||||
|
||||
private Long currentPage;
|
||||
private Long items;
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.xhpc.card.mapper;
|
||||
|
||||
import com.xhpc.card.domain.queryClientUsersCondition;
|
||||
import com.xhpc.card.pojo.TIccardClientUsers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TIccardClientUsersMapper {
|
||||
|
||||
int deleteByPrimaryKey(Integer usersid);
|
||||
|
||||
int insert(TIccardClientUsers record);
|
||||
|
||||
int insertSelective(TIccardClientUsers record);
|
||||
|
||||
TIccardClientUsers selectByPrimaryKey(Integer usersid);
|
||||
|
||||
int updateByPrimaryKeySelective(TIccardClientUsers record);
|
||||
|
||||
int updateByPrimaryKey(TIccardClientUsers record);
|
||||
|
||||
/**
|
||||
* query users by query condition
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 18:11
|
||||
* @since version-1.0
|
||||
*/
|
||||
List<TIccardClientUsers> selectByCondition(queryClientUsersCondition queryCondition);
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.xhpc.card.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* t_iccard_client_users
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
@Data
|
||||
public class TIccardClientUsers implements Serializable {
|
||||
|
||||
private Integer usersid;
|
||||
|
||||
/**
|
||||
* 命名规则:字母数字组合
|
||||
*/
|
||||
private String usersname;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String userspwd;
|
||||
|
||||
/**
|
||||
* 用户电话
|
||||
*/
|
||||
private String usersphone;
|
||||
|
||||
/**
|
||||
* 用户Email
|
||||
*/
|
||||
private String usersemail;
|
||||
|
||||
/**
|
||||
* 用户地址
|
||||
*/
|
||||
private String usersadress;
|
||||
|
||||
/**
|
||||
* 用户级别 3.运营商管理员 4.平台管理员
|
||||
*/
|
||||
private Byte userslevel;
|
||||
|
||||
/**
|
||||
* 所属运营商id,对应xhpc_operator.operator_id
|
||||
*/
|
||||
private Integer userscorp;
|
||||
|
||||
/**
|
||||
* 所属运营商前缀
|
||||
*/
|
||||
private String corpno;
|
||||
|
||||
/**
|
||||
* 所属运营商名称
|
||||
*/
|
||||
private String corpname;
|
||||
|
||||
/**
|
||||
* 添加日期
|
||||
*/
|
||||
private Date userstime;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段(0,存在,1为删除)
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xhpc.card.service;
|
||||
|
||||
import com.xhpc.card.domain.*;
|
||||
import com.xhpc.card.pojo.TIccardClientUsers;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
|
||||
import java.util.List;
|
||||
@ -158,4 +159,40 @@ public interface IXhpcCardService {
|
||||
*/
|
||||
R<Object> removeBinding(Long cardRecordId);
|
||||
|
||||
/**
|
||||
* add a client user info
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:15
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<Object> addClientUser(TIccardClientUsers userInfo);
|
||||
|
||||
/**
|
||||
* update the client user info
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:20
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<Object> updateClientUser(TIccardClientUsers userInfo);
|
||||
|
||||
/**
|
||||
* delete the client user by user id
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:27
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<Object> deleteClientUser(Integer userInfo);
|
||||
|
||||
/**
|
||||
* query client users by query condition
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/24 17:39
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<Object> queryClientUsers(queryClientUsersCondition queryCondition);
|
||||
|
||||
}
|
||||
|
||||
@ -53,6 +53,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
private TIccardLogMapper tIccardLogMapper;
|
||||
@Resource
|
||||
private XhpcRechargeOrderMapper xhpcRechargeOrderMapper;
|
||||
@Resource
|
||||
private TIccardClientUsersMapper tIccardClientUsersMapper;
|
||||
|
||||
@Override
|
||||
public R cardStartup(String cardno, String serialNumber, String rateModelId) {
|
||||
@ -658,6 +660,37 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Object> addClientUser(TIccardClientUsers userInfo) {
|
||||
|
||||
userInfo.setUsersid(null);
|
||||
tIccardClientUsersMapper.insertSelective(userInfo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Object> updateClientUser(TIccardClientUsers userInfo) {
|
||||
|
||||
tIccardClientUsersMapper.updateByPrimaryKeySelective(userInfo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Object> deleteClientUser(Integer userId) {
|
||||
|
||||
TIccardClientUsers user = tIccardClientUsersMapper.selectByPrimaryKey(userId);
|
||||
user.setDelFlag(1);
|
||||
tIccardClientUsersMapper.updateByPrimaryKey(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Object> queryClientUsers(queryClientUsersCondition queryCondition) {
|
||||
|
||||
List<TIccardClientUsers> usersList = tIccardClientUsersMapper.selectByCondition(queryCondition);
|
||||
return R.ok(usersList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于QueryRechargeRecord方法封装DTO数据
|
||||
*
|
||||
|
||||
@ -0,0 +1,190 @@
|
||||
<?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">
|
||||
<!--suppress ALL -->
|
||||
<mapper namespace="com.xhpc.card.mapper.TIccardClientUsersMapper">
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.card.pojo.TIccardClientUsers">
|
||||
<id column="usersID" jdbcType="INTEGER" property="usersid"/>
|
||||
<result column="usersName" jdbcType="VARCHAR" property="usersname"/>
|
||||
<result column="usersPwd" jdbcType="VARCHAR" property="userspwd"/>
|
||||
<result column="usersPhone" jdbcType="VARCHAR" property="usersphone"/>
|
||||
<result column="usersEmail" jdbcType="VARCHAR" property="usersemail"/>
|
||||
<result column="usersAdress" jdbcType="VARCHAR" property="usersadress"/>
|
||||
<result column="usersLevel" jdbcType="TINYINT" property="userslevel"/>
|
||||
<result column="usersCorp" jdbcType="INTEGER" property="userscorp"/>
|
||||
<result column="corpNo" jdbcType="VARCHAR" property="corpno"/>
|
||||
<result column="corpName" jdbcType="VARCHAR" property="corpname"/>
|
||||
<result column="usersTime" jdbcType="TIMESTAMP" property="userstime"/>
|
||||
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
|
||||
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
usersID
|
||||
, usersName, usersPwd, usersPhone, usersEmail, usersAdress, usersLevel, usersCorp,
|
||||
corpNo, corpName, usersTime, tenant_id, del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_iccard_client_users
|
||||
where usersID = #{usersid,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByCondition" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_iccard_client_users
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete
|
||||
from t_iccard_client_users
|
||||
where usersID = #{usersid,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="usersID" keyProperty="usersid" parameterType="com.xhpc.card.pojo.TIccardClientUsers"
|
||||
useGeneratedKeys="true">
|
||||
insert into t_iccard_client_users (usersName, usersPwd, usersPhone,
|
||||
usersEmail, usersAdress, usersLevel,
|
||||
usersCorp, corpNo, corpName,
|
||||
usersTime, tenant_id, del_flag)
|
||||
values (#{usersname,jdbcType=VARCHAR}, #{userspwd,jdbcType=VARCHAR}, #{usersphone,jdbcType=VARCHAR},
|
||||
#{usersemail,jdbcType=VARCHAR}, #{usersadress,jdbcType=VARCHAR}, #{userslevel,jdbcType=TINYINT},
|
||||
#{userscorp,jdbcType=INTEGER}, #{corpno,jdbcType=VARCHAR}, #{corpname,jdbcType=VARCHAR},
|
||||
#{userstime,jdbcType=TIMESTAMP}, #{tenantId,jdbcType=VARCHAR}, #{delFlag,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="usersID" keyProperty="usersid"
|
||||
parameterType="com.xhpc.card.pojo.TIccardClientUsers" useGeneratedKeys="true">
|
||||
insert into t_iccard_client_users
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="usersname != null">
|
||||
usersName,
|
||||
</if>
|
||||
<if test="userspwd != null">
|
||||
usersPwd,
|
||||
</if>
|
||||
<if test="usersphone != null">
|
||||
usersPhone,
|
||||
</if>
|
||||
<if test="usersemail != null">
|
||||
usersEmail,
|
||||
</if>
|
||||
<if test="usersadress != null">
|
||||
usersAdress,
|
||||
</if>
|
||||
<if test="userslevel != null">
|
||||
usersLevel,
|
||||
</if>
|
||||
<if test="userscorp != null">
|
||||
usersCorp,
|
||||
</if>
|
||||
<if test="corpno != null">
|
||||
corpNo,
|
||||
</if>
|
||||
<if test="corpname != null">
|
||||
corpName,
|
||||
</if>
|
||||
<if test="userstime != null">
|
||||
usersTime,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="usersname != null">
|
||||
#{usersname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userspwd != null">
|
||||
#{userspwd,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersphone != null">
|
||||
#{usersphone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersemail != null">
|
||||
#{usersemail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersadress != null">
|
||||
#{usersadress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userslevel != null">
|
||||
#{userslevel,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="userscorp != null">
|
||||
#{userscorp,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="corpno != null">
|
||||
#{corpno,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="corpname != null">
|
||||
#{corpname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userstime != null">
|
||||
#{userstime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.card.pojo.TIccardClientUsers">
|
||||
update t_iccard_client_users
|
||||
<set>
|
||||
<if test="usersname != null">
|
||||
usersName = #{usersname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userspwd != null">
|
||||
usersPwd = #{userspwd,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersphone != null">
|
||||
usersPhone = #{usersphone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersemail != null">
|
||||
usersEmail = #{usersemail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="usersadress != null">
|
||||
usersAdress = #{usersadress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userslevel != null">
|
||||
usersLevel = #{userslevel,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="userscorp != null">
|
||||
usersCorp = #{userscorp,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="corpno != null">
|
||||
corpNo = #{corpno,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="corpname != null">
|
||||
corpName = #{corpname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userstime != null">
|
||||
usersTime = #{userstime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where usersID = #{usersid,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.xhpc.card.pojo.TIccardClientUsers">
|
||||
update t_iccard_client_users
|
||||
set usersName = #{usersname,jdbcType=VARCHAR},
|
||||
usersPwd = #{userspwd,jdbcType=VARCHAR},
|
||||
usersPhone = #{usersphone,jdbcType=VARCHAR},
|
||||
usersEmail = #{usersemail,jdbcType=VARCHAR},
|
||||
usersAdress = #{usersadress,jdbcType=VARCHAR},
|
||||
usersLevel = #{userslevel,jdbcType=TINYINT},
|
||||
usersCorp = #{userscorp,jdbcType=INTEGER},
|
||||
corpNo = #{corpno,jdbcType=VARCHAR},
|
||||
corpName = #{corpname,jdbcType=VARCHAR},
|
||||
usersTime = #{userstime,jdbcType=TIMESTAMP},
|
||||
tenant_id = #{tenantId,jdbcType=VARCHAR},
|
||||
del_flag = #{delFlag,jdbcType=INTEGER}
|
||||
where usersID = #{usersid,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user