|
|
@@ -0,0 +1,165 @@
|
|
|
+<?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.goafanti.standard.dao.StandardPlatformLinkDao">
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.standard.model.StandardPlatformLink" id="StandardPlatformLinkMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="url" column="url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="aid" column="aid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
+ <result property="sort" column="sort" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="StandardPlatformLinkMap">
|
|
|
+ select id,
|
|
|
+ name,
|
|
|
+ url,
|
|
|
+ aid,
|
|
|
+ status,
|
|
|
+ sort,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ from standard_platform_link
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAllByLimit" resultMap="StandardPlatformLinkMap">
|
|
|
+ select
|
|
|
+ id, name, url, aid, status, sort, create_time, update_time
|
|
|
+ from standard_platform_link
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ and url = #{url}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ and sort = #{sort}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and update_time = #{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from standard_platform_link
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ and url = #{url}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ and sort = #{sort}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and update_time = #{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
|
|
|
+ values (#{name}, #{url}, #{aid}, #{status}, #{sort}, #{createTime}, #{updateTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.name}, #{entity.url}, #{entity.aid}, #{entity.status}, #{entity.sort}, #{entity.createTime},
|
|
|
+ #{entity.updateTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.name}, #{entity.url}, #{entity.aid}, #{entity.status}, #{entity.sort}, #{entity.createTime},
|
|
|
+ #{entity.updateTime})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ name = values(name),
|
|
|
+ url = values(url),
|
|
|
+ aid = values(aid),
|
|
|
+ status = values(status),
|
|
|
+ sort = values(sort),
|
|
|
+ create_time = values(create_time),
|
|
|
+ update_time = values(update_time)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update standard_platform_link
|
|
|
+ <set>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ url = #{url},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ aid = #{aid},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ sort = #{sort},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from standard_platform_link
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|