- 新增设备试用期过期时间字段及管理接口 - 实现试用期状态检查与过期提醒逻辑 - 支持账号类型区分试用与付费用户 - 添加设备注册时自动设置3天试用期- 实现VIP状态刷新与过期类型判断 -优化账号列表查询支持按客户端用户名过滤 - 更新客户端设备管理支持试用期控制- 完善登录流程支持试用期状态提示 -修复设备离线通知缺少用户名参数问题 - 调整账号默认设置清除逻辑关联客户端用户名
112 lines
5.6 KiB
XML
112 lines
5.6 KiB
XML
<?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.system.mapper.ClientAccountMapper">
|
|
|
|
<resultMap type="ClientAccount" id="ClientAccountResult">
|
|
<result property="id" column="id" />
|
|
<result property="accountName" column="account_name" />
|
|
<result property="username" column="username" />
|
|
<result property="password" column="password" />
|
|
<result property="status" column="status" />
|
|
<result property="expireTime" column="expire_time" />
|
|
<result property="allowedIpRange" column="allowed_ip_range" />
|
|
<result property="remark" column="remark" />
|
|
<result property="permissions" column="permissions" />
|
|
<result property="deviceLimit" column="device_limit" />
|
|
<result property="accountType" column="account_type" />
|
|
<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="selectClientAccountVo">
|
|
select id, account_name, username, password, status, expire_time,
|
|
allowed_ip_range, remark, permissions, device_limit, account_type, create_by, create_time, update_by, update_time
|
|
from client_account
|
|
</sql>
|
|
|
|
<select id="selectClientAccountList" parameterType="ClientAccount" resultMap="ClientAccountResult">
|
|
<include refid="selectClientAccountVo"/>
|
|
<where>
|
|
<if test="accountName != null and accountName != ''"> and account_name like concat('%', #{accountName}, '%')</if>
|
|
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectClientAccountById" parameterType="Long" resultMap="ClientAccountResult">
|
|
<include refid="selectClientAccountVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<select id="selectClientAccountByUsername" parameterType="String" resultMap="ClientAccountResult">
|
|
<include refid="selectClientAccountVo"/>
|
|
where username = #{username}
|
|
</select>
|
|
|
|
<insert id="insertClientAccount" parameterType="ClientAccount" useGeneratedKeys="true" keyProperty="id">
|
|
insert into client_account
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="accountName != null">account_name,</if>
|
|
<if test="username != null">username,</if>
|
|
<if test="password != null">password,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="expireTime != null">expire_time,</if>
|
|
<if test="allowedIpRange != null">allowed_ip_range,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="permissions != null">permissions,</if>
|
|
<if test="deviceLimit != null">device_limit,</if>
|
|
<if test="accountType != null">account_type,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
create_time
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="accountName != null">#{accountName},</if>
|
|
<if test="username != null">#{username},</if>
|
|
<if test="password != null">#{password},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="expireTime != null">#{expireTime},</if>
|
|
<if test="allowedIpRange != null">#{allowedIpRange},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="permissions != null">#{permissions},</if>
|
|
<if test="deviceLimit != null">#{deviceLimit},</if>
|
|
<if test="accountType != null">#{accountType},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
sysdate()
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateClientAccount" parameterType="ClientAccount">
|
|
update client_account
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="accountName != null">account_name = #{accountName},</if>
|
|
<if test="username != null">username = #{username},</if>
|
|
<if test="password != null">password = #{password},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="expireTime != null">expire_time = #{expireTime},</if>
|
|
<if test="allowedIpRange != null">allowed_ip_range = #{allowedIpRange},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="permissions != null">permissions = #{permissions},</if>
|
|
<if test="deviceLimit != null">device_limit = #{deviceLimit},</if>
|
|
<if test="accountType != null">account_type = #{accountType},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
update_time = sysdate()
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteClientAccountById" parameterType="Long">
|
|
delete from client_account where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteClientAccountByIds" parameterType="String">
|
|
delete from client_account where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |