<?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.njcn.csdevice.mapper.CsEdDataMapper">
    <resultMap id="BaseResultMap" type="com.njcn.csdevice.pojo.po.CsEdDataPO">
        <!--@mbg.generated-->
        <!--@Table cs_ed_data-->
        <result column="id" jdbcType="VARCHAR" property="id"/>
        <result column="dev_type" jdbcType="VARCHAR" property="devType"/>
        <result column="version_no" jdbcType="VARCHAR" property="versionNo"/>
        <result column="version_agreement" jdbcType="VARCHAR" property="versionAgreement"/>
        <result column="version_date" jdbcType="TIMESTAMP" property="versionDate"/>
        <result column="describe" jdbcType="VARCHAR" property="describe"/>
        <result column="version_type" jdbcType="VARCHAR" property="versionType"/>
        <result column="status" jdbcType="BOOLEAN" property="status"/>
        <result column="file_path" jdbcType="VARCHAR" property="filePath"/>
        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id, dev_type, version_no, version_agreement, version_date, `describe`, version_type,
        `status`, file_path, create_by, create_time, update_by, update_time
    </sql>
    <select id="getPage" resultType="com.njcn.csdevice.pojo.vo.CsEdDataVO">
        SELECT a.* FROM cs_ed_data a
                WHERE
                1 = 1
        <if test="csEdDataQueryParm.versionStartDate != null and csEdDataQueryParm.versionStartDate != ''">
            AND a.version_date &gt;= #{csEdDataQueryParm.versionStartDate }
        </if>
        <if test="csEdDataQueryParm.versionendDate != null and csEdDataQueryParm.versionendDate != ''">
            AND a.version_date &lt;= #{csEdDataQueryParm.versionendDate }
        </if>

        <if test="csEdDataQueryParm.devName != null and csEdDataQueryParm.devName != ''">
            AND a.dev_type_name LIKE concat('%',#{csEdDataQueryParm.devName},'%')
        </if>
        <if test="csEdDataQueryParm.devType != null and csEdDataQueryParm.devType != ''">
            AND a.dev_type = #{csEdDataQueryParm.devType}
        </if>
    </select>
</mapper>