<?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.devplatform.transfer.modules.sys.dao.SysSynchDatalogDao">
    <!-- Result Map -->
    <resultMap id="BaseResultMap" type="com.devplatform.transfer.modules.sys.bean.SysSynchDatalog">
        <result column="id" property="id"/>
        <result column="sql_str" property="sqlStr"/>
        <result column="status" property="status"/>
        <result column="station_id" property="stationId"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="byx1" property="byx1"/>
        <result column="byx2" property="byx2"/>
        <result column="byx3" property="byx3"/>
    </resultMap>

    <!-- sys_synch_datalog table all fields -->
    <sql id="Base_Column_List">
        id,sql_str,status,station_id,create_time,update_time,byx1,byx2,byx3
    </sql>

    <!-- 公共查询条件 -->

    <sql id="Example_Where_Clause">
        where deleted=0
        <if test="id!=null and id!=''">and id = #{id}</if>
        <if test="sqlStr!=null ">and sql_str = #{sqlStr}</if>
        <if test="status!=null ">and status = #{status}</if>
        <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
        <if test="createTime!=null ">and create_time = #{createTime}</if>
        <if test="updateTime!=null ">and update_time = #{updateTime}</if>
        <if test="byx1!=null and byx1!=''">and byx1 = #{byx1}</if>
        <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
        <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
    </sql>
    <select id="getAllErrStation" resultType="java.util.HashMap">
        SELECT station_id AS stationId, COUNT(1) AS total
        FROM sys_synch_datalog
        WHERE `status` = 0
        HAVING total > 0
    </select>


</mapper>


