郑永安
2023-06-19 59e91a4e9ddaf23cebb12993c774aa899ab22d16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?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.gk.firework.Mapper.CustomerInfoMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.CustomerInfo" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="gender" property="gender" jdbcType="TINYINT" />
    <result column="idcardnum" property="idcardnum" jdbcType="VARCHAR" />
    <result column="nation" property="nation" jdbcType="VARCHAR" />
    <result column="bornday" property="bornday" jdbcType="DATE" />
    <result column="address" property="address" jdbcType="VARCHAR" />
    <result column="frequency" property="frequency" jdbcType="INTEGER" />
    <result column="num" property="num" jdbcType="INTEGER" />
    <result column="lasttime" property="lasttime" jdbcType="TIMESTAMP" />
    <result column="lastnum" property="lastnum" jdbcType="INTEGER" />
    <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
    <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" />
    <result column="path" property="path" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, `name`, gender, idcardnum, nation, bornday, address, frequency, num, lasttime,
    lastnum, createddate, modifieddate,path
  </sql>
  <select id="selectCustomerByIdCardNum" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from customer
    <where>
      idcardnum = #{idCardNumber}
    </where>
  </select>
  <select id="getCustomerBySaleOrder" resultMap="BaseResultMap">
    select
    customer.id,
    customer.`name`,
    customer.gender,
    customer.idcardnum,
    customer.nation,
    customer.bornday,
    customer.address,
    customer.frequency,
    customer.num,
    customer.lasttime,
    customer.lastnum,
    customer.createddate,
    customer.modifieddate,
    customer.path
    from customer as customer
    left join saleorder as so on so.customer = customer.id
    <where>
      so.`code` = #{orderCode}
    </where>
  </select>
 
</mapper>