This commit is contained in:
雷欧(林平凡)
2025-08-03 03:10:04 +08:00
parent b8bd248229
commit dbf082ae0c
2 changed files with 90 additions and 3 deletions

View File

@@ -0,0 +1,87 @@
<?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.jarvis.mapper.SuperAdminMapper">
<resultMap type="SuperAdmin" id="SuperAdminResult">
<result property="id" column="id"/>
<result property="wxid" column="wxid"/>
<result property="name" column="name"/>
<result property="unionId" column="union_id"/>
<result property="appKey" column="app_key"/>
<result property="secretKey" column="secret_key"/>
<result property="isActive" column="is_active"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
</resultMap>
<sql id="selectSuperAdminVo">
select id, wxid, name, union_id, app_key, secret_key, is_active, created_at, updated_at from super_admin
</sql>
<select id="selectSuperAdminList" parameterType="SuperAdmin" resultMap="SuperAdminResult">
<include refid="selectSuperAdminVo"/>
<where>
<if test="wxid != null and wxid != ''"> and wxid = #{wxid}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
<if test="appKey != null and appKey != ''"> and app_key = #{appKey}</if>
<if test="secretKey != null and secretKey != ''"> and secret_key = #{secretKey}</if>
<if test="isActive != null "> and is_active = #{isActive}</if>
</where>
order by created_at desc
</select>
<select id="selectSuperAdminById" parameterType="Long" resultMap="SuperAdminResult">
<include refid="selectSuperAdminVo"/>
where id = #{id}
</select>
<insert id="insertSuperAdmin" parameterType="SuperAdmin" useGeneratedKeys="true" keyProperty="id">
insert into super_admin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="wxid != null and wxid != ''">wxid,</if>
<if test="name != null and name != ''">name,</if>
<if test="unionId != null and unionId != ''">union_id,</if>
<if test="appKey != null and appKey != ''">app_key,</if>
<if test="secretKey != null and secretKey != ''">secret_key,</if>
<if test="isActive != null">is_active,</if>
created_at,
updated_at,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wxid != null and wxid != ''">#{wxid},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="unionId != null and unionId != ''">#{unionId},</if>
<if test="appKey != null and appKey != ''">#{appKey},</if>
<if test="secretKey != null and secretKey != ''">#{secretKey},</if>
<if test="isActive != null">#{isActive},</if>
now(),
now(),
</trim>
</insert>
<update id="updateSuperAdmin" parameterType="SuperAdmin">
update super_admin
<trim prefix="SET" suffixOverrides=",">
<if test="wxid != null and wxid != ''">wxid = #{wxid},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="unionId != null and unionId != ''">union_id = #{unionId},</if>
<if test="appKey != null and appKey != ''">app_key = #{appKey},</if>
<if test="secretKey != null and secretKey != ''">secret_key = #{secretKey},</if>
<if test="isActive != null">is_active = #{isActive},</if>
updated_at = now(),
</trim>
where id = #{id}
</update>
<delete id="deleteSuperAdminById" parameterType="Long">
delete from super_admin where id = #{id}
</delete>
<delete id="deleteSuperAdminByIds" parameterType="Long">
delete from super_admin where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>