104 lines
5.0 KiB
XML
104 lines
5.0 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="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, 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="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="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="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> |