Files
fateverse/custom-query/custom-query-biz/src/main/resources/mapper/PortalMapper.xml
2024-04-18 23:29:47 +08:00

78 lines
3.2 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="cn.fateverse.query.mapper.PortalMapper">
<sql id="selectVo">
select portal_id,
query_id,
adapter_id,
portal_name,
anonymity,
type,
request_method,
create_data_adapter,
path,
url,
state,
create_by,
create_time,
update_by,
update_time,
remark
from portal
</sql>
<select id="selectById" resultType="cn.fateverse.query.entity.Portal">
<include refid="selectVo"/>
where portal_id = #{portalId}
</select>
<select id="selectList" resultType="cn.fateverse.query.entity.Portal">
<include refid="selectVo"/>
<where>
<if test="portalName != null and portalName != ''">and portal_name like concat('%', #{portalName}, '%') </if>
<if test="anonymity != null ">and anonymity = #{anonymity}</if>
<if test="type != null">and type = #{type}</if>
<if test="path != null and path != ''">and path like concat('%', #{path}, '%')</if>
</where>
</select>
<select id="selectByPath" resultType="cn.fateverse.query.entity.Portal">
<include refid="selectVo"/>
where path = #{path} and request_method = #{requestMethod} limit 1
</select>
<insert id="insert" useGeneratedKeys="true" keyColumn="portal_id" keyProperty="portalId">
insert into portal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="queryId != null">query_id,</if>
<if test="adapterId != null">adapter_id,</if>
<if test="portalName != null">portal_name,</if>
<if test="anonymity != null">anonymity,</if>
<if test="type != null">type,</if>
<if test="requestMethod != null">request_method,</if>
<if test="createDataAdapter != null">create_data_adapter,</if>
<if test="path != null">path,</if>
<if test="url != null">url,</if>
<if test="state != null">state,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="queryId != null">#{queryId},</if>
<if test="adapterId != null">#{adapterId},</if>
<if test="portalName != null">#{portalName},</if>
<if test="anonymity != null">#{anonymity},</if>
<if test="type != null">#{type},</if>
<if test="requestMethod != null">#{requestMethod},</if>
<if test="createDataAdapter != null">#{createDataAdapter},</if>
<if test="path != null">#{path},</if>
<if test="url != null">#{url},</if>
<if test="state != null">#{state},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
</mapper>