<?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.deer.wms.base.system.dao.ServerVisitAddressMapper">
  <resultMap id="BaseResultMap" type="com.deer.wms.base.system.model.ServerVisitAddress">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="visit_address_id" jdbcType="INTEGER" property="visitAddressId" />
    <result column="visit_address" jdbcType="VARCHAR" property="visitAddress" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="account" jdbcType="VARCHAR" property="account" />
    <result column="password" jdbcType="VARCHAR" property="password" />
  </resultMap>
  <select id="findList" parameterType="com.deer.wms.base.system.model.ServerVisitAddressCriteria" resultMap="BaseResultMap">
    select * from server_visit_address
    where 1=1
    <if test="visitAddressId != null">
      and visit_address_id = #{visitAddressId}
    </if>
    <if test="keyWordList != null">
      and
      <foreach collection="keyWordList" item="keyWord" index="index" open="(" separator="and" close=")">
        (
        visit_address LIKE binary CONCAT('%', #{keyWord}, '%')
        or description like binary CONCAT('%', #{keyWord}, '%')
        )
      </foreach>
    </if>
  </select>
  <select id="findAddressById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select * from server_visit_address where visit_address_id = #{id}
  </select>
</mapper>