<?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.ssj.service.mapper.ConchDerverMapper" >
    <resultMap id="BaseResultMap" type="com.ssj.bean.conch.conch.domain.ConchDerver" >
        <id column="id" property="id" jdbcType="VARCHAR" />
        <result column="derver" property="derver" jdbcType="VARCHAR" />
        <result column="imei" property="imei" jdbcType="VARCHAR" />
        <result column="simcard" property="simcard" jdbcType="VARCHAR"/>
    </resultMap>
    
    <sql id="Base_Column_List" >
        id, derver, imei, simcard
    </sql>

    <select id="findAllConchDerver" resultMap="BaseResultMap"  >
       SELECT 
       <include refid="Base_Column_List" />
	   FROM conch_derver
    </select>

    <!-- 新增条件查询 -->
    <select id="findByDerver" parameterType="java.lang.String" resultType="hashMap">
        select
        <include refid="Base_Column_List" />
        from conch_derver
        where 1=1
        <if test="derver != null and derver!=''">
            and derver = #{derver}
        </if>
        order by id desc
    </select>

    <!-- 新增条件查询 -->
    <select id="findDerverBySelective" parameterType="hashMap" resultType="hashMap">
        select
        <include refid="Base_Column_List" />
        from conch_derver
        where 1=1
        <if test="derver != null and derver!=''">
            and derver = #{derver}
        </if>
    </select>
</mapper>