新增删除接口,修改部分逻辑
parent
0fbd48b449
commit
3363ef88c8
@ -1,388 +1,412 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.sztzjy.resource_center.mapper.admin.AdminDataMapper">
|
<mapper namespace="com.sztzjy.resource_center.mapper.admin.AdminDataMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.admin.AdminData">
|
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.admin.AdminData">
|
||||||
<id column="data_id" jdbcType="VARCHAR" property="dataId"/>
|
<id column="data_id" jdbcType="VARCHAR" property="dataId" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
<result column="source" jdbcType="VARCHAR" property="source" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
||||||
type="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
<result column="data_scenarios" jdbcType="LONGVARCHAR" property="dataScenarios" />
|
||||||
<result column="data_scenarios" jdbcType="LONGVARCHAR" property="dataScenarios"/>
|
<result column="data_scenarios_original" jdbcType="LONGVARCHAR" property="dataScenariosOriginal" />
|
||||||
<result column="field_description" jdbcType="LONGVARCHAR" property="fieldDescription"/>
|
<result column="field_description" jdbcType="LONGVARCHAR" property="fieldDescription" />
|
||||||
</resultMap>
|
<result column="field_description_original" jdbcType="LONGVARCHAR" property="fieldDescriptionOriginal" />
|
||||||
<sql id="Example_Where_Clause">
|
</resultMap>
|
||||||
<where>
|
<sql id="Example_Where_Clause">
|
||||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
<where>
|
||||||
<if test="criteria.valid">
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
<if test="criteria.valid">
|
||||||
<foreach collection="criteria.criteria" item="criterion">
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<choose>
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
<when test="criterion.noValue">
|
<choose>
|
||||||
and ${criterion.condition}
|
<when test="criterion.noValue">
|
||||||
</when>
|
and ${criterion.condition}
|
||||||
<when test="criterion.singleValue">
|
</when>
|
||||||
and ${criterion.condition} #{criterion.value}
|
<when test="criterion.singleValue">
|
||||||
</when>
|
and ${criterion.condition} #{criterion.value}
|
||||||
<when test="criterion.betweenValue">
|
</when>
|
||||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
<when test="criterion.betweenValue">
|
||||||
</when>
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
<when test="criterion.listValue">
|
</when>
|
||||||
and ${criterion.condition}
|
<when test="criterion.listValue">
|
||||||
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
and ${criterion.condition}
|
||||||
separator=",">
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
#{listItem}
|
#{listItem}
|
||||||
</foreach>
|
</foreach>
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</foreach>
|
|
||||||
</trim>
|
|
||||||
</if>
|
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</trim>
|
||||||
</sql>
|
|
||||||
<sql id="Update_By_Example_Where_Clause">
|
|
||||||
<where>
|
|
||||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
||||||
<if test="criteria.valid">
|
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
||||||
<foreach collection="criteria.criteria" item="criterion">
|
|
||||||
<choose>
|
|
||||||
<when test="criterion.noValue">
|
|
||||||
and ${criterion.condition}
|
|
||||||
</when>
|
|
||||||
<when test="criterion.singleValue">
|
|
||||||
and ${criterion.condition} #{criterion.value}
|
|
||||||
</when>
|
|
||||||
<when test="criterion.betweenValue">
|
|
||||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
||||||
</when>
|
|
||||||
<when test="criterion.listValue">
|
|
||||||
and ${criterion.condition}
|
|
||||||
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
||||||
separator=",">
|
|
||||||
#{listItem}
|
|
||||||
</foreach>
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
</foreach>
|
|
||||||
</trim>
|
|
||||||
</if>
|
|
||||||
</foreach>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
data_id
|
|
||||||
, name, picture_url, status, source, create_time
|
|
||||||
</sql>
|
|
||||||
<sql id="Blob_Column_List">
|
|
||||||
data_scenarios
|
|
||||||
, field_description
|
|
||||||
</sql>
|
|
||||||
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample"
|
|
||||||
resultMap="ResultMapWithBLOBs">
|
|
||||||
select
|
|
||||||
<if test="distinct">
|
|
||||||
distinct
|
|
||||||
</if>
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
,
|
|
||||||
<include refid="Blob_Column_List"/>
|
|
||||||
from admin_data
|
|
||||||
<if test="_parameter != null">
|
|
||||||
<include refid="Example_Where_Clause"/>
|
|
||||||
</if>
|
|
||||||
<if test="orderByClause != null">
|
|
||||||
order by ${orderByClause}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample"
|
|
||||||
resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<if test="distinct">
|
|
||||||
distinct
|
|
||||||
</if>
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from admin_data
|
|
||||||
<if test="_parameter != null">
|
|
||||||
<include refid="Example_Where_Clause"/>
|
|
||||||
</if>
|
</if>
|
||||||
<if test="orderByClause != null">
|
</foreach>
|
||||||
order by ${orderByClause}
|
</where>
|
||||||
</if>
|
</sql>
|
||||||
</select>
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
<where>
|
||||||
select
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
<include refid="Base_Column_List"/>
|
<if test="criteria.valid">
|
||||||
,
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<include refid="Blob_Column_List"/>
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
from admin_data
|
<choose>
|
||||||
where data_id = #{dataId,jdbcType=VARCHAR}
|
<when test="criterion.noValue">
|
||||||
</select>
|
and ${criterion.condition}
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
</when>
|
||||||
delete
|
<when test="criterion.singleValue">
|
||||||
from admin_data
|
and ${criterion.condition} #{criterion.value}
|
||||||
where data_id = #{dataId,jdbcType=VARCHAR}
|
</when>
|
||||||
</delete>
|
<when test="criterion.betweenValue">
|
||||||
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample">
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
delete from admin_data
|
</when>
|
||||||
<if test="_parameter != null">
|
<when test="criterion.listValue">
|
||||||
<include refid="Example_Where_Clause"/>
|
and ${criterion.condition}
|
||||||
</if>
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
</delete>
|
#{listItem}
|
||||||
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
</foreach>
|
||||||
insert into admin_data (data_id, name, picture_url,
|
</when>
|
||||||
status, source, create_time,
|
</choose>
|
||||||
data_scenarios, field_description)
|
</foreach>
|
||||||
values (#{dataId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pictureUrl,jdbcType=VARCHAR},
|
</trim>
|
||||||
#{status,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
#{dataScenarios,jdbcType=LONGVARCHAR}, #{fieldDescription,jdbcType=LONGVARCHAR})
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
|
||||||
insert into admin_data
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dataId != null">
|
|
||||||
data_id,
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
name,
|
|
||||||
</if>
|
|
||||||
<if test="pictureUrl != null">
|
|
||||||
picture_url,
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status,
|
|
||||||
</if>
|
|
||||||
<if test="source != null">
|
|
||||||
source,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time,
|
|
||||||
</if>
|
|
||||||
<if test="dataScenarios != null">
|
|
||||||
data_scenarios,
|
|
||||||
</if>
|
|
||||||
<if test="fieldDescription != null">
|
|
||||||
field_description,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dataId != null">
|
|
||||||
#{dataId,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
#{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="pictureUrl != null">
|
|
||||||
#{pictureUrl,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
#{status,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="source != null">
|
|
||||||
#{source,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="dataScenarios != null">
|
|
||||||
#{dataScenarios,jdbcType=LONGVARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="fieldDescription != null">
|
|
||||||
#{fieldDescription,jdbcType=LONGVARCHAR},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample"
|
|
||||||
resultType="java.lang.Long">
|
|
||||||
select count(*) from admin_data
|
|
||||||
<if test="_parameter != null">
|
|
||||||
<include refid="Example_Where_Clause"/>
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
<update id="updateByExampleSelective" parameterType="map">
|
|
||||||
update admin_data
|
|
||||||
<set>
|
|
||||||
<if test="record.dataId != null">
|
|
||||||
data_id = #{record.dataId,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.name != null">
|
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.pictureUrl != null">
|
|
||||||
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.status != null">
|
|
||||||
status = #{record.status,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="record.source != null">
|
|
||||||
source = #{record.source,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="record.dataScenarios != null">
|
|
||||||
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.fieldDescription != null">
|
|
||||||
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
<if test="_parameter != null">
|
|
||||||
<include refid="Update_By_Example_Where_Clause"/>
|
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</foreach>
|
||||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
</where>
|
||||||
update admin_data
|
</sql>
|
||||||
set data_id = #{record.dataId,jdbcType=VARCHAR},
|
<sql id="Base_Column_List">
|
||||||
|
data_id, name, picture_url, status, source, create_time
|
||||||
|
</sql>
|
||||||
|
<sql id="Blob_Column_List">
|
||||||
|
data_scenarios, data_scenarios_original, field_description, field_description_original
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample" resultMap="ResultMapWithBLOBs">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
,
|
||||||
|
<include refid="Blob_Column_List" />
|
||||||
|
from admin_data
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from admin_data
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
,
|
||||||
|
<include refid="Blob_Column_List" />
|
||||||
|
from admin_data
|
||||||
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete from admin_data
|
||||||
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample">
|
||||||
|
delete from admin_data
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
||||||
|
insert into admin_data (data_id, name, picture_url,
|
||||||
|
status, source, create_time,
|
||||||
|
data_scenarios, data_scenarios_original,
|
||||||
|
field_description, field_description_original
|
||||||
|
)
|
||||||
|
values (#{dataId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pictureUrl,jdbcType=VARCHAR},
|
||||||
|
#{status,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{dataScenarios,jdbcType=LONGVARCHAR}, #{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
|
#{fieldDescription,jdbcType=LONGVARCHAR}, #{fieldDescriptionOriginal,jdbcType=LONGVARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
||||||
|
insert into admin_data
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataId != null">
|
||||||
|
data_id,
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
name,
|
||||||
|
</if>
|
||||||
|
<if test="pictureUrl != null">
|
||||||
|
picture_url,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
status,
|
||||||
|
</if>
|
||||||
|
<if test="source != null">
|
||||||
|
source,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="dataScenarios != null">
|
||||||
|
data_scenarios,
|
||||||
|
</if>
|
||||||
|
<if test="dataScenariosOriginal != null">
|
||||||
|
data_scenarios_original,
|
||||||
|
</if>
|
||||||
|
<if test="fieldDescription != null">
|
||||||
|
field_description,
|
||||||
|
</if>
|
||||||
|
<if test="fieldDescriptionOriginal != null">
|
||||||
|
field_description_original,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataId != null">
|
||||||
|
#{dataId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
#{name,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="pictureUrl != null">
|
||||||
|
#{pictureUrl,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="source != null">
|
||||||
|
#{source,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="dataScenarios != null">
|
||||||
|
#{dataScenarios,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="dataScenariosOriginal != null">
|
||||||
|
#{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="fieldDescription != null">
|
||||||
|
#{fieldDescription,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="fieldDescriptionOriginal != null">
|
||||||
|
#{fieldDescriptionOriginal,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from admin_data
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update admin_data
|
||||||
|
<set>
|
||||||
|
<if test="record.dataId != null">
|
||||||
|
data_id = #{record.dataId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.name != null">
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.pictureUrl != null">
|
||||||
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.status != null">
|
||||||
status = #{record.status,jdbcType=INTEGER},
|
status = #{record.status,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.source != null">
|
||||||
source = #{record.source,jdbcType=VARCHAR},
|
source = #{record.source,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.dataScenarios != null">
|
||||||
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
||||||
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR}
|
</if>
|
||||||
<if test="_parameter != null">
|
<if test="record.dataScenariosOriginal != null">
|
||||||
<include refid="Update_By_Example_Where_Clause"/>
|
data_scenarios_original = #{record.dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
</if>
|
||||||
</update>
|
<if test="record.fieldDescription != null">
|
||||||
<update id="updateByExample" parameterType="map">
|
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR},
|
||||||
update admin_data
|
</if>
|
||||||
set data_id = #{record.dataId,jdbcType=VARCHAR},
|
<if test="record.fieldDescriptionOriginal != null">
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
field_description_original = #{record.fieldDescriptionOriginal,jdbcType=LONGVARCHAR},
|
||||||
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
</if>
|
||||||
status = #{record.status,jdbcType=INTEGER},
|
</set>
|
||||||
source = #{record.source,jdbcType=VARCHAR},
|
<if test="_parameter != null">
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
<if test="_parameter != null">
|
</if>
|
||||||
<include refid="Update_By_Example_Where_Clause"/>
|
</update>
|
||||||
</if>
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||||
</update>
|
update admin_data
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
set data_id = #{record.dataId,jdbcType=VARCHAR},
|
||||||
update admin_data
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
<set>
|
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
||||||
<if test="name != null">
|
status = #{record.status,jdbcType=INTEGER},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
source = #{record.source,jdbcType=VARCHAR},
|
||||||
</if>
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
<if test="pictureUrl != null">
|
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
||||||
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
data_scenarios_original = #{record.dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
</if>
|
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR},
|
||||||
<if test="status != null">
|
field_description_original = #{record.fieldDescriptionOriginal,jdbcType=LONGVARCHAR}
|
||||||
status = #{status,jdbcType=INTEGER},
|
<if test="_parameter != null">
|
||||||
</if>
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
<if test="source != null">
|
</if>
|
||||||
source = #{source,jdbcType=VARCHAR},
|
</update>
|
||||||
</if>
|
<update id="updateByExample" parameterType="map">
|
||||||
<if test="createTime != null">
|
update admin_data
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
set data_id = #{record.dataId,jdbcType=VARCHAR},
|
||||||
</if>
|
name = #{record.name,jdbcType=VARCHAR},
|
||||||
<if test="dataScenarios != null">
|
picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
|
||||||
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
status = #{record.status,jdbcType=INTEGER},
|
||||||
</if>
|
source = #{record.source,jdbcType=VARCHAR},
|
||||||
<if test="fieldDescription != null">
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
||||||
field_description = #{fieldDescription,jdbcType=LONGVARCHAR},
|
<if test="_parameter != null">
|
||||||
</if>
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</set>
|
</if>
|
||||||
where data_id = #{dataId,jdbcType=VARCHAR}
|
</update>
|
||||||
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
||||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
update admin_data
|
||||||
update admin_data
|
<set>
|
||||||
set name = #{name,jdbcType=VARCHAR},
|
<if test="name != null">
|
||||||
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
||||||
status = #{status,jdbcType=INTEGER},
|
</if>
|
||||||
source = #{source,jdbcType=VARCHAR},
|
<if test="pictureUrl != null">
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
||||||
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
</if>
|
||||||
field_description = #{fieldDescription,jdbcType=LONGVARCHAR}
|
<if test="status != null">
|
||||||
where data_id = #{dataId,jdbcType=VARCHAR}
|
status = #{status,jdbcType=INTEGER},
|
||||||
</update>
|
</if>
|
||||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.admin.AdminData">
|
<if test="source != null">
|
||||||
update admin_data
|
source = #{source,jdbcType=VARCHAR},
|
||||||
set name = #{name,jdbcType=VARCHAR},
|
</if>
|
||||||
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
<if test="createTime != null">
|
||||||
status = #{status,jdbcType=INTEGER},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
source = #{source,jdbcType=VARCHAR},
|
</if>
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
<if test="dataScenarios != null">
|
||||||
where data_id = #{dataId,jdbcType=VARCHAR}
|
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
||||||
</update>
|
</if>
|
||||||
|
<if test="dataScenariosOriginal != null">
|
||||||
|
data_scenarios_original = #{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
<resultMap id="dtoMap" type="com.sztzjy.resource_center.entity.admin.AdminDataReturnDto">
|
</if>
|
||||||
<id column="data_id" jdbcType="VARCHAR" property="dataId"/>
|
<if test="fieldDescription != null">
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
field_description = #{fieldDescription,jdbcType=LONGVARCHAR},
|
||||||
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
|
</if>
|
||||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
<if test="fieldDescriptionOriginal != null">
|
||||||
<result column="data_scenarios" jdbcType="LONGVARCHAR" property="dataScenarios"/>
|
field_description_original = #{fieldDescriptionOriginal,jdbcType=LONGVARCHAR},
|
||||||
<result column="field_description" jdbcType="LONGVARCHAR" property="fieldDescription"/>
|
</if>
|
||||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
</set>
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
||||||
<result column="id" jdbcType="VARCHAR" property="collectId"/>
|
</update>
|
||||||
<collection property="adminDataLabels" ofType="com.sztzjy.resource_center.entity.admin.AdminDataLabel">
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
||||||
<id column="label_id" jdbcType="VARCHAR" property="labelId"/>
|
update admin_data
|
||||||
<result column="label_name" jdbcType="VARCHAR" property="name"/>
|
set name = #{name,jdbcType=VARCHAR},
|
||||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
||||||
<result column="data_case_id" jdbcType="VARCHAR" property="dataCaseId"/>
|
status = #{status,jdbcType=INTEGER},
|
||||||
</collection>
|
source = #{source,jdbcType=VARCHAR},
|
||||||
<collection property="adminFiles" ofType="com.sztzjy.resource_center.entity.admin.AdminFile">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
<id column="file_url" jdbcType="VARCHAR" property="fileUrl"/>
|
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
||||||
<id column="file_id" jdbcType="VARCHAR" property="fileId"/>
|
data_scenarios_original = #{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
||||||
<result column="file_name" jdbcType="VARCHAR" property="name"/>
|
field_description = #{fieldDescription,jdbcType=LONGVARCHAR},
|
||||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
field_description_original = #{fieldDescriptionOriginal,jdbcType=LONGVARCHAR}
|
||||||
<result column="data_case_id" jdbcType="VARCHAR" property="dataCaseId"/>
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
||||||
</collection>
|
</update>
|
||||||
</resultMap>
|
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.admin.AdminData">
|
||||||
|
update admin_data
|
||||||
<select id="selectByConditions" resultMap="dtoMap">
|
set name = #{name,jdbcType=VARCHAR},
|
||||||
SELECT a.data_id,a.name,a.picture_url,a.data_scenarios,a.field_description,a.`status`,a.source,a.create_time,
|
picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
||||||
ad.`name`as label_name,ad.label_id,ad.type,ad.data_case_id,
|
status = #{status,jdbcType=INTEGER},
|
||||||
af.file_url,af.`name` as file_name,af.source,af.file_id,af.data_case_id
|
source = #{source,jdbcType=VARCHAR},
|
||||||
FROM admin_data a
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||||
LEFT join admin_data_label ad ON a.data_id = ad.data_case_id
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
||||||
LEFT JOIN admin_file af on a.data_id = af.data_case_id
|
</update>
|
||||||
LEFT JOIN admin_collect_data acc on a.data_id = acc.data_id
|
<resultMap id="dtoMap" type="com.sztzjy.resource_center.entity.admin.AdminDataReturnDto">
|
||||||
<where>
|
<id column="data_id" jdbcType="VARCHAR" property="dataId"/>
|
||||||
<if test="keyWord !=null and keyWord !=''">
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||||
and a.name like CONCAT('%', #{keyWord}, '%')
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
|
||||||
</if>
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||||
<if test="labelName !=null and labelName !=''">
|
<result column="data_scenarios" jdbcType="LONGVARCHAR" property="dataScenarios"/>
|
||||||
and ad.name in (#{labelName})
|
<result column="data_scenarios_original" jdbcType="LONGVARCHAR" property="dataScenariosOriginal"/>
|
||||||
</if>
|
<result column="field_description" jdbcType="LONGVARCHAR" property="fieldDescription"/>
|
||||||
<if test="type !=null and type !=''">
|
<result column="field_description_original" jdbcType="LONGVARCHAR" property="fieldDescriptionOriginal"/>
|
||||||
and a.source != '管理员'
|
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||||
</if>
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
</where>
|
<result column="id" jdbcType="VARCHAR" property="collectId"/>
|
||||||
order by a.create_time desc
|
<collection property="adminDataLabels" ofType="com.sztzjy.resource_center.entity.admin.AdminDataLabel">
|
||||||
</select>
|
<id column="label_id" jdbcType="VARCHAR" property="labelId"/>
|
||||||
|
<result column="label_name" jdbcType="VARCHAR" property="name"/>
|
||||||
|
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||||
|
<result column="data_case_id" jdbcType="VARCHAR" property="dataCaseId"/>
|
||||||
|
</collection>
|
||||||
|
<collection property="adminFiles" ofType="com.sztzjy.resource_center.entity.admin.AdminFile">
|
||||||
|
<id column="file_url" jdbcType="VARCHAR" property="fileUrl"/>
|
||||||
|
<id column="file_id" jdbcType="VARCHAR" property="fileId"/>
|
||||||
|
<result column="file_name" jdbcType="VARCHAR" property="name"/>
|
||||||
|
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||||
|
<result column="data_case_id" jdbcType="VARCHAR" property="dataCaseId"/>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectByConditions" resultMap="dtoMap">
|
||||||
|
SELECT a.data_id,a.name,a.picture_url,a.data_scenarios,a.data_scenarios_original,a.field_description,a.field_description_original,a.`status`,a.source,a.create_time,
|
||||||
|
ad.`name`as label_name,ad.label_id,ad.type,ad.data_case_id,
|
||||||
|
af.file_url,af.`name` as file_name,af.source,af.file_id,af.data_case_id
|
||||||
|
FROM admin_data a
|
||||||
|
LEFT join admin_data_label ad ON a.data_id = ad.data_case_id
|
||||||
|
LEFT JOIN admin_file af on a.data_id = af.data_case_id
|
||||||
|
LEFT JOIN admin_collect_data acc on a.data_id = acc.data_id
|
||||||
|
<where>
|
||||||
|
<if test="keyWord !=null and keyWord !=''">
|
||||||
|
and a.name like CONCAT('%', #{keyWord}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="labelName !=null and labelName !=''">
|
||||||
|
and ad.name in (#{labelName})
|
||||||
|
</if>
|
||||||
|
<if test="type !=null and type !=''">
|
||||||
|
and a.source != '管理员'
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by a.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectByConditionsBySchoolId" resultMap="dtoMap">
|
|
||||||
SELECT a.data_id,a.name,a.picture_url,a.data_scenarios,a.field_description,a.`status`,a.source,a.create_time,
|
|
||||||
ad.`name`as label_name,ad.label_id,ad.type,ad.data_case_id,
|
|
||||||
af.file_url,af.`name` as file_name,af.source,af.file_id,af.data_case_id,
|
|
||||||
acc.id
|
|
||||||
FROM admin_data a
|
|
||||||
LEFT join admin_data_label ad ON a.data_id = ad.data_case_id
|
|
||||||
LEFT JOIN admin_file af on a.data_id = af.data_case_id
|
|
||||||
LEFT JOIN admin_collect_data acc on a.data_id = acc.data_id
|
|
||||||
<where>
|
|
||||||
and a.status=1
|
|
||||||
<if test="keyWord !=null and keyWord !=''">
|
|
||||||
and a.name like CONCAT('%', #{keyWord}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="labelName !=null and labelName !=''">
|
|
||||||
and ad.name = #{labelName}
|
|
||||||
</if>
|
|
||||||
<if test="source !=null and source !=''">
|
|
||||||
and a.source in (#{source},'管理员')
|
|
||||||
</if>
|
|
||||||
<if test="userId !=null and userId !=''">
|
|
||||||
and acc.user_id = #{userId}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
order by a.create_time desc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
<select id="selectByConditionsBySchoolId" resultMap="dtoMap">
|
||||||
|
SELECT a.data_id,a.name,a.picture_url,a.data_scenarios,a.data_scenarios_original,a.field_description,a.field_description_original,a.`status`,a.source,a.create_time,
|
||||||
|
ad.`name`as label_name,ad.label_id,ad.type,ad.data_case_id,
|
||||||
|
af.file_url,af.`name` as file_name,af.source,af.file_id,af.data_case_id,
|
||||||
|
acc.id
|
||||||
|
FROM admin_data a
|
||||||
|
LEFT join admin_data_label ad ON a.data_id = ad.data_case_id
|
||||||
|
LEFT JOIN admin_file af on a.data_id = af.data_case_id
|
||||||
|
LEFT JOIN admin_collect_data acc on a.data_id = acc.data_id
|
||||||
|
<where>
|
||||||
|
and a.status=1
|
||||||
|
<if test="keyWord !=null and keyWord !=''">
|
||||||
|
and a.name like CONCAT('%', #{keyWord}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="labelName !=null and labelName !=''">
|
||||||
|
and ad.name = #{labelName}
|
||||||
|
</if>
|
||||||
|
<if test="source !=null and source !=''">
|
||||||
|
and a.source in (#{source},'管理员')
|
||||||
|
</if>
|
||||||
|
<if test="userId !=null and userId !=''">
|
||||||
|
and acc.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by a.create_time desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue