PublicDataProcessingMapper.xml 2.92 KB
<?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="cn.com.glsx.dj.dataprocessing.mapper.PublicDataProcessingMapper">
    <resultMap id="BaseResultMap" type="cn.com.glsx.dj.dataprocessing.model.PublicDataProcessing">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="table_name" property="tableName" jdbcType="VARCHAR"/>
        <result column="primary_key_name" property="primaryKeyName" jdbcType="VARCHAR"/>
        <result column="column_name" property="columnName" jdbcType="VARCHAR"/>
        <result column="column_type" property="columnType" jdbcType="INTEGER"/>
        <result column="total_count" property="totalCount" jdbcType="INTEGER"/>
        <result column="end_count" property="endCount" jdbcType="INTEGER"/>
        <result column="complete" property="complete" jdbcType="TINYINT"/>
        <result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
        <result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
        <result column="updated_by" property="updatedBy" jdbcType="VARCHAR"/>
        <result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
        -->
        id, table_name, primary_key_name, column_name, column_type, total_count, end_count, complete, created_by, created_time,
        updated_by,
        updated_time, del_flag
    </sql>
    <update id="updateTableData">
        UPDATE ${tableName} SET ${columnName}=#{updateValue} WHERE ${primaryKeyName}=#{primaryValue}
    </update>
    <select id="getTableConfig" resultMap="BaseResultMap">
        SELECT * FROM `public_data_procesing` WHERE del_flag='N' AND complete=0
    </select>
    <select id="getDataByOneConfig" resultType="cn.com.glsx.dj.dataprocessing.dto.ReplaceDTO">
        SELECT ${columnName} oldValue,${primaryKeyName} primaryValue FROM ${tableName}
        <where>
            ${columnName} NOT REGEXP #{endpoint} AND
            <foreach collection="keywordList" item="keyword" separator="OR" open="(" close=")">
                ${columnName} REGEXP #{keyword}
            </foreach>
            <if test="limitId != null">
                AND ${primaryKeyName} &gt; #{limitId}
            </if>
        </where>
        ORDER BY ${primaryKeyName} ASC
    </select>
    <select id="getTotalCount" resultType="java.lang.Integer">
        SELECT COUNT(*) FROM ${tableName}
        <where>
            ${columnName} NOT REGEXP #{endpoint} AND
            <foreach collection="keywordList" item="keyword" separator="OR" open="(" close=")">
                ${columnName} REGEXP #{keyword}
            </foreach>
        </where>
    </select>
</mapper>