|
|
@@ -0,0 +1,67 @@
|
|
|
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.shinsoft.sto.mapper.main.CustomerMapper">
|
|
|
4
|
+
|
|
|
5
|
+ <resultMap id="BaseResultMap" type="com.shinsoft.sto.model.main.Customer">
|
|
|
6
|
+ <id column="id" property="id" jdbcType="VARCHAR"/>
|
|
|
7
|
+ <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR"/>
|
|
|
8
|
+ <result column="process_instance_status" property="processInstanceStatus" jdbcType="VARCHAR"/>
|
|
|
9
|
+ <result column="add_id" property="addId" jdbcType="VARCHAR"/>
|
|
|
10
|
+ <result column="add_code" property="addCode" jdbcType="VARCHAR"/>
|
|
|
11
|
+ <result column="add_name" property="addName" jdbcType="VARCHAR"/>
|
|
|
12
|
+ <result column="add_dept_code" property="addDeptCode" jdbcType="VARCHAR"/>
|
|
|
13
|
+ <result column="add_dept_name" property="addDeptName" jdbcType="VARCHAR"/>
|
|
|
14
|
+ <result column="add_time" property="addTime" jdbcType="TIMESTAMP"/>
|
|
|
15
|
+ <result column="modify_id" property="modifyId" jdbcType="VARCHAR"/>
|
|
|
16
|
+ <result column="modify_code" property="modifyCode" jdbcType="VARCHAR"/>
|
|
|
17
|
+ <result column="modify_name" property="modifyName" jdbcType="VARCHAR"/>
|
|
|
18
|
+ <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
|
|
19
|
+ <result column="cancel_id" property="cancelId" jdbcType="VARCHAR"/>
|
|
|
20
|
+ <result column="cancel_code" property="cancelCode" jdbcType="VARCHAR"/>
|
|
|
21
|
+ <result column="cancel_name" property="cancelName" jdbcType="VARCHAR"/>
|
|
|
22
|
+ <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP"/>
|
|
|
23
|
+ <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR"/>
|
|
|
24
|
+ <result column="belong_id" property="belongId" jdbcType="VARCHAR"/>
|
|
|
25
|
+ <result column="customer_name" property="customerName" jdbcType="VARCHAR"/>
|
|
|
26
|
+ <result column="customer_abbreviation" property="customerAbbreviation" jdbcType="VARCHAR"/>
|
|
|
27
|
+ <result column="customer_contact" property="customerContact" jdbcType="VARCHAR"/>
|
|
|
28
|
+ <result column="contact_information" property="contactInformation" jdbcType="VARCHAR"/>
|
|
|
29
|
+ <result column="default_address" property="defaultAddress" jdbcType="VARCHAR"/>
|
|
|
30
|
+ <result column="remarks" property="remarks" jdbcType="VARCHAR"/>
|
|
|
31
|
+ <result column="active_status" property="activeStatus" jdbcType="VARCHAR"/>
|
|
|
32
|
+ <result column="operation" property="operation" jdbcType="VARCHAR"/>
|
|
|
33
|
+ <result column="test" property="test" jdbcType="VARCHAR"/>
|
|
|
34
|
+ </resultMap>
|
|
|
35
|
+
|
|
|
36
|
+ <sql id="Base_Column_List">
|
|
|
37
|
+ id, process_instance_id, process_instance_status, add_id, add_code, add_name, add_dept_code,
|
|
|
38
|
+ add_dept_name, add_time, modify_id, modify_code, modify_name, modify_time, cancel_id,
|
|
|
39
|
+ cancel_code, cancel_name, cancel_time, cancel_flag, belong_id, customer_name, customer_abbreviation,
|
|
|
40
|
+ customer_contact, contact_information, default_address, remarks, active_status, operation, test
|
|
|
41
|
+ </sql>
|
|
|
42
|
+
|
|
|
43
|
+ <select id="selectCustomerPage" resultMap="BaseResultMap">
|
|
|
44
|
+ select
|
|
|
45
|
+ <include refid="Base_Column_List"/>
|
|
|
46
|
+ from STO_MAIN_CUSTOMER
|
|
|
47
|
+ where nvl(cancel_flag,'0') = '0'
|
|
|
48
|
+ and belong_id = #{belongId}
|
|
|
49
|
+ <if test="query != null and query != ''">
|
|
|
50
|
+ and (customer_name like '%' || #{query} || '%'
|
|
|
51
|
+ or customer_abbreviation like '%' || #{query} || '%'
|
|
|
52
|
+ or customer_contact like '%' || #{query} || '%'
|
|
|
53
|
+ or contact_information like '%' || #{query} || '%')
|
|
|
54
|
+ </if>
|
|
|
55
|
+ order by add_time desc
|
|
|
56
|
+ </select>
|
|
|
57
|
+
|
|
|
58
|
+ <select id="selectByCustomerName" resultMap="BaseResultMap">
|
|
|
59
|
+ select
|
|
|
60
|
+ <include refid="Base_Column_List"/>
|
|
|
61
|
+ from STO_MAIN_CUSTOMER
|
|
|
62
|
+ where nvl(cancel_flag,'0') = '0'
|
|
|
63
|
+ and belong_id = #{belongId}
|
|
|
64
|
+ and customer_name = #{customerName}
|
|
|
65
|
+ </select>
|
|
|
66
|
+
|
|
|
67
|
+</mapper>
|