|
@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="Data" id="DataResult">
|
|
|
<result property="id" column="id" />
|
|
|
+ <result property="dataName" column="data_name" />
|
|
|
<result property="dataType" column="data_type" />
|
|
|
<result property="dataPath" column="data_path" />
|
|
|
<result property="createBy" column="create_by" />
|
|
@@ -16,15 +17,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDataVo">
|
|
|
- select id, data_type, data_path, create_by, create_time, update_by, update_time, remark from t_data
|
|
|
+ select id, data_name, data_type, data_path, create_by, create_time, update_by, update_time, remark from t_data
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDataList" parameterType="Data" resultMap="DataResult">
|
|
|
<include refid="selectDataVo"/>
|
|
|
<where>
|
|
|
+ <if test="dataName != null and dataName != ''"> and data_name like concat('%', #{dataName}, '%')</if>
|
|
|
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
|
|
|
+ <if test="dataPath != null and dataPath != ''"> and data_path = #{dataPath}</if>
|
|
|
</where>
|
|
|
- order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDataById" parameterType="Long" resultMap="DataResult">
|
|
@@ -35,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<insert id="insertData" parameterType="Data" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into t_data
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dataName != null">data_name,</if>
|
|
|
<if test="dataType != null and dataType != ''">data_type,</if>
|
|
|
<if test="dataPath != null">data_path,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
@@ -44,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="remark != null">remark,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dataName != null">#{dataName},</if>
|
|
|
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
|
|
<if test="dataPath != null">#{dataPath},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
@@ -57,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="updateData" parameterType="Data">
|
|
|
update t_data
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="dataName != null">data_name = #{dataName},</if>
|
|
|
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
|
|
<if test="dataPath != null">data_path = #{dataPath},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|