|
|
|
@ -2,17 +2,18 @@
|
|
|
|
|
<!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">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.admin.AdminData">
|
|
|
|
|
<id column="data_id" jdbcType="VARCHAR" property="dataId"/>
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
|
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
|
|
|
<result column="source" jdbcType="VARCHAR" property="source"/>
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<id column="data_id" jdbcType="VARCHAR" property="dataId" />
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status" />
|
|
|
|
|
<result column="source" jdbcType="VARCHAR" property="source" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
|
|
|
|
type="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
|
|
|
|
<result column="data_scenarios" jdbcType="LONGVARCHAR" property="dataScenarios"/>
|
|
|
|
|
<result column="field_description" jdbcType="LONGVARCHAR" property="fieldDescription"/>
|
|
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
|
|
|
|
<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_original" jdbcType="LONGVARCHAR" property="fieldDescriptionOriginal" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
|
<where>
|
|
|
|
@ -32,8 +33,7 @@
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
|
separator=",">
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
@ -62,8 +62,7 @@
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
|
separator=",">
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
@ -75,40 +74,36 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
data_id
|
|
|
|
|
, name, picture_url, status, source, create_time
|
|
|
|
|
data_id, name, picture_url, status, source, create_time
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Blob_Column_List">
|
|
|
|
|
data_scenarios
|
|
|
|
|
, field_description
|
|
|
|
|
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 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="Base_Column_List" />
|
|
|
|
|
,
|
|
|
|
|
<include refid="Blob_Column_List"/>
|
|
|
|
|
<include refid="Blob_Column_List" />
|
|
|
|
|
from admin_data
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
<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 id="selectByExample" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataExample" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from admin_data
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
@ -116,30 +111,33 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
,
|
|
|
|
|
<include refid="Blob_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
|
|
|
|
|
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"/>
|
|
|
|
|
<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, field_description)
|
|
|
|
|
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}, #{fieldDescription,jdbcType=LONGVARCHAR})
|
|
|
|
|
#{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
|
|
|
|
@ -165,9 +163,15 @@
|
|
|
|
|
<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">
|
|
|
|
@ -191,16 +195,21 @@
|
|
|
|
|
<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 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"/>
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
@ -227,12 +236,18 @@
|
|
|
|
|
<if test="record.dataScenarios != null">
|
|
|
|
|
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.dataScenariosOriginal != null">
|
|
|
|
|
data_scenarios_original = #{record.dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.fieldDescription != null">
|
|
|
|
|
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="record.fieldDescriptionOriginal != null">
|
|
|
|
|
field_description_original = #{record.fieldDescriptionOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
|
@ -244,9 +259,11 @@
|
|
|
|
|
source = #{record.source,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
data_scenarios = #{record.dataScenarios,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR}
|
|
|
|
|
data_scenarios_original = #{record.dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description = #{record.fieldDescription,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description_original = #{record.fieldDescriptionOriginal,jdbcType=LONGVARCHAR}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
@ -258,7 +275,7 @@
|
|
|
|
|
source = #{record.source,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.admin.AdminDataWithBLOBs">
|
|
|
|
@ -282,9 +299,15 @@
|
|
|
|
|
<if test="dataScenarios != null">
|
|
|
|
|
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dataScenariosOriginal != null">
|
|
|
|
|
data_scenarios_original = #{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fieldDescription != null">
|
|
|
|
|
field_description = #{fieldDescription,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fieldDescriptionOriginal != null">
|
|
|
|
|
field_description_original = #{fieldDescriptionOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
@ -296,7 +319,9 @@
|
|
|
|
|
source = #{source,jdbcType=VARCHAR},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
data_scenarios = #{dataScenarios,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description = #{fieldDescription,jdbcType=LONGVARCHAR}
|
|
|
|
|
data_scenarios_original = #{dataScenariosOriginal,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description = #{fieldDescription,jdbcType=LONGVARCHAR},
|
|
|
|
|
field_description_original = #{fieldDescriptionOriginal,jdbcType=LONGVARCHAR}
|
|
|
|
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.admin.AdminData">
|
|
|
|
@ -308,15 +333,15 @@
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
where data_id = #{dataId,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="dtoMap" type="com.sztzjy.resource_center.entity.admin.AdminDataReturnDto">
|
|
|
|
|
<id column="data_id" jdbcType="VARCHAR" property="dataId"/>
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
|
|
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/>
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
|
|
|
<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_original" jdbcType="LONGVARCHAR" property="fieldDescriptionOriginal"/>
|
|
|
|
|
<result column="source" jdbcType="VARCHAR" property="source"/>
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<result column="id" jdbcType="VARCHAR" property="collectId"/>
|
|
|
|
@ -336,7 +361,7 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectByConditions" resultMap="dtoMap">
|
|
|
|
|
SELECT a.data_id,a.name,a.picture_url,a.data_scenarios,a.field_description,a.`status`,a.source,a.create_time,
|
|
|
|
|
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
|
|
|
|
@ -359,7 +384,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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,
|
|
|
|
|
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
|
|
|
|
@ -384,5 +409,4 @@
|
|
|
|
|
</where>
|
|
|
|
|
order by a.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|