<?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.DevInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.DevInfo">
        <id column="id" property="id" />
        <result column="num" property="num" />
        <result column="dev_num" property="devNum" />
        <result column="dev_name" property="devName" />
        <result column="trade_type_code" property="tradeTypeCode" />
        <result column="trade_type" property="tradeType" />
        <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, num, dev_num, dev_name, trade_type_code, trade_type, userid, update_time, del_flag, dept_id
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.jljc.entity.DevInfo">
        select <include refid="Base_Column_List"></include>
        from dev_info
        <trim prefix="where" prefixOverrides="and">
            <if test="query.devNum != null and query.devNum != ''">
                and dev_num like concat("%",#{query.devNum},"%")
            </if>
            <if test="query.devName != null and query.devName != ''">
                and dev_name like concat("%",#{query.devName},"%")
            </if>
            <if test="query.tradeType != null and query.tradeType != ''">
                and trade_type= #{query.tradeType}
            </if>
            <if test="query.tradeTypeCode != null and query.tradeTypeCode != ''">
                and trade_type_code = #{query.tradeTypeCode}
            </if>
            <if test="query.delFlag != null and query.delFlag != ''">
                and del_flag = #{query.delFlag}
            </if>
        </trim>
    </select>

</mapper>
