Authored by kun

新增mapper

  1 +package com.yohoufo.dal.order;
  2 +
  3 +import com.yohoufo.dal.order.model.ExpressCompany;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author kun.wang
  9 + * @date 2018/9/25
  10 + */
  11 +public interface ExpressCompanyMapper {
  12 +
  13 + /**
  14 + * 查询全部的快递公司信息
  15 + * @return
  16 + */
  17 + List<ExpressCompany> queryAllExpressCompany();
  18 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.yohoufo.dal.order.ExpressCompanyMapper">
  4 +
  5 + <resultMap id="expressCompany" type="com.yohoufo.dal.order.model.ExpressCompany">
  6 + <id property="id" column="id"/>
  7 + <result property="companyName" column="company_name"/>
  8 + </resultMap>
  9 +
  10 + <select id="queryAllExpressCompany" resultMap="expressCompany">
  11 + select id, company_name
  12 + from express_company
  13 + </select>
  14 +
  15 +</mapper>