|
|
@@ -0,0 +1,107 @@
|
|
|
+<?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.siwei.apply.mapper.ConvergeMapper">
|
|
|
+ <resultMap id="convergeMap" type="com.siwei.apply.domain.Converge">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="batch_name" property="batchName"/>
|
|
|
+ <result column="operation_time" property="operationTime"/>
|
|
|
+ <result column="file_path" property="filePath"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="read_message" property="readMessage"/>
|
|
|
+ <result column="file_cost_time" property="fileCostTime"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <insert id="add" parameterType="com.siwei.apply.domain.Converge">
|
|
|
+ INSERT INTO t_converge (
|
|
|
+ id, name, batch_name, operation_time, file_path, status, type, read_message, file_cost_time, create_time
|
|
|
+ ) VALUES (
|
|
|
+ #{id}, #{name}, #{batchName}, now(), #{filePath}, #{status}, #{type}, #{readMessage}, #{fileCostTime}, now()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="get" resultMap="convergeMap">
|
|
|
+ SELECT *
|
|
|
+ FROM t_converge
|
|
|
+ WHERE id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getList" parameterType="com.siwei.apply.domain.vo.ConvergeFilterVo" resultMap="convergeMap">
|
|
|
+ SELECT *
|
|
|
+ FROM t_converge
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND name LIKE CONCAT('%', #{name}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="batchName != null and batchName != ''">
|
|
|
+ AND batch_name LIKE CONCAT('%', #{batchName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ AND type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ AND "operation_time" >= TO_TIMESTAMP(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND "operation_time" <= TO_TIMESTAMP(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') + INTERVAL '1 day'
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ LIMIT #{pageSize} OFFSET #{offset}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCount" parameterType="com.siwei.apply.domain.vo.ConvergeFilterVo" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM t_converge
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND name LIKE CONCAT('%', #{name}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="batchName != null and batchName != ''">
|
|
|
+ AND batch_name LIKE CONCAT('%', #{batchName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ AND type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ AND "operation_time" >= TO_TIMESTAMP(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND "operation_time" <= TO_TIMESTAMP(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') + INTERVAL '1 day'
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.siwei.apply.domain.vo.ConvergeUpdateVo">
|
|
|
+ UPDATE t_converge
|
|
|
+ <set>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="batchName != null">batch_name = #{batchName},</if>
|
|
|
+ <if test="filePath != null">file_path = #{filePath},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="readMessage != null">read_message = #{readMessage},</if>
|
|
|
+ <if test="fileCostTime != null">file_cost_time = #{fileCostTime},</if>
|
|
|
+ operation_time = now()
|
|
|
+ </set>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="batchDelete">
|
|
|
+ DELETE FROM t_converge
|
|
|
+ WHERE id IN
|
|
|
+ <foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|