<?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.nantian.cloud.jljc.mapper.EcAbnormalVolatilityMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.EcAbnormalVolatility">
        <id column="id" property="id" />
        <result column="epc" property="epc" />
        <result column="epc_name" property="epcName" />
        <result column="year" property="year" />
        <result column="area" property="area" />
        <result column="area2" property="area2" />
        <result column="trade_num" property="tradeNum" />
        <result column="trade_num2" property="tradeNum2" />
        <result column="data_status" property="dataStatus" />
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, epc, epc_name, year, area, area2, trade_num, trade_num2, data_status, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.EcAbnormalVolatility">
        select <include refid="Base_Column_List"></include>
        from ec_abnormal_volatility
        where del_flag = "1"
        <if test="query.epcName != null and query.epcName != ''">
            and epc_name like concat("%",#{query.epcName},"%")
        </if>
        <if test="query.year != null and query.year != ''">
            and year = #{query.year}
        </if>
        <if test="query.dataStatus != null and query.dataStatus != ''">
            and data_status = #{query.dataStatus}
        </if>
        <if test="query.area != null and query.area != ''">
            and area =  #{query.area}
        </if>
        <if test="query.area2 != null and query.area2 != ''">
            and area2 =  #{query.area2}
        </if>
        <if test="query.tradeNum != null and query.tradeNum != ''">
            and trade_num = #{query.tradeNum}
        </if>
        <if test="query.tradeNum2 != null and query.tradeNum2 != ''">
            and trade_num2 = #{query.tradeNum2}
        </if>
    </select>

</mapper>
