PublicDataProcessingMapper.xml
2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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} > #{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>