75 lines
3.4 KiB
XML
75 lines
3.4 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.app.mapper.AppContactMapper">
|
||
|
|
|
||
|
|
<resultMap type="AppContactPage" id="AppContactPageResult">
|
||
|
|
<result property="id" column="id" />
|
||
|
|
<result property="avatarUrl" column="avatar_url" />
|
||
|
|
<result property="nickname" column="nickname" />
|
||
|
|
<result property="bio" column="bio" />
|
||
|
|
<result property="backgroundUrl" column="background_url" />
|
||
|
|
<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>
|
||
|
|
|
||
|
|
<resultMap type="AppContactItem" id="AppContactItemResult">
|
||
|
|
<result property="id" column="id" />
|
||
|
|
<result property="type" column="type" />
|
||
|
|
<result property="label" column="label" />
|
||
|
|
<result property="value" column="contact_value" />
|
||
|
|
<result property="iconUrl" column="icon_url" />
|
||
|
|
<result property="qrCodeUrl" column="qr_code_url" />
|
||
|
|
<result property="actionType" column="action_type" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="sort" column="sort" />
|
||
|
|
<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>
|
||
|
|
|
||
|
|
<select id="selectAppContactPage" resultMap="AppContactPageResult">
|
||
|
|
select id, avatar_url, nickname, bio, background_url,
|
||
|
|
create_by, create_time, update_by, update_time
|
||
|
|
from app_contact_page
|
||
|
|
where id = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectAppContactItemList" resultMap="AppContactItemResult">
|
||
|
|
select id, type, label, contact_value, icon_url, qr_code_url, action_type,
|
||
|
|
status, sort, create_by, create_time, update_by, update_time
|
||
|
|
from app_contact_item
|
||
|
|
<if test="status != null and status != ''">where status = #{status}</if>
|
||
|
|
order by sort asc, id asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="upsertAppContactPage" parameterType="AppContactPage">
|
||
|
|
insert into app_contact_page
|
||
|
|
(id, avatar_url, nickname, bio, background_url, create_by, create_time, update_by, update_time)
|
||
|
|
values
|
||
|
|
(1, #{avatarUrl}, #{nickname}, #{bio}, #{backgroundUrl},
|
||
|
|
#{updateBy}, #{updateTime}, #{updateBy}, #{updateTime})
|
||
|
|
on duplicate key update
|
||
|
|
avatar_url = values(avatar_url), nickname = values(nickname), bio = values(bio),
|
||
|
|
background_url = values(background_url), update_by = values(update_by),
|
||
|
|
update_time = values(update_time)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<delete id="deleteAllAppContactItems">
|
||
|
|
delete from app_contact_item
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<insert id="insertAppContactItem" parameterType="AppContactItem" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into app_contact_item
|
||
|
|
(type, label, contact_value, icon_url, qr_code_url, action_type, status, sort,
|
||
|
|
create_by, create_time, update_by, update_time)
|
||
|
|
values
|
||
|
|
(#{type}, #{label}, #{value}, #{iconUrl}, #{qrCodeUrl}, #{actionType}, #{status}, #{sort},
|
||
|
|
#{createBy}, #{createTime}, #{updateBy}, #{updateTime})
|
||
|
|
</insert>
|
||
|
|
</mapper>
|