AppraiseAddress.xml 1.2 KB
<?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.yoho.order.dal.AppraiseAddressMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.AppraiseAddress">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="type" property="type" jdbcType="INTEGER" />
      <result column="area_code" property="areaCode" jdbcType="INTEGER" />
      <result column="address_name" property="addressName" jdbcType="VARCHAR" />
      <result column="mobile" property="mobile" jdbcType="VARCHAR" />
      <result column="address" property="address" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List">
        id, type, area_code, address_name, mobile, address
    </sql>

    <select id="selectAddressByType" resultType="java.lang.String">
        select distinct address 
        from appraise_address where type = #{type}
    </select>
    
    <select id="selectByType" resultMap = "BaseResultMap">
        select <include refid="Base_Column_List"></include> 
        from appraise_address where type= #{type} 
        limit 1
    
    </select>
    
</mapper>