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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?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="cn.wise.sc.acquisition.business.mapper.TProcessesDrillingMapper">
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesDrillingColumns">
a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HoleID,
a.DrillingDate,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.EquipmentID,
a.Driver,
a.StartTime,
a.EndTime,
a.WorkTime,
a.HoleBlastVolume,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.Azimuth,
a.Inclination,
a.Aperture,
a.x,
a.y,
a.z,
a.Operator,
a.Accepter,
a.Bz,
a.Tag
</sql>
<sql id="TProcessesDiggingHoleColumns">
b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace,
b.Azimuth AS DesignAzimuth,
b.Inclination AS DesignInclination,
b.Aperture AS DesignAperture,
b.StepHeight,
</sql>
<sql id="TProcessesBlastColumns">
c.BlastDate,
</sql>
<sql id="TProcessesBlastdesignVolumeColumns">
d.BlastVolume,
d.DesignDate,
</sql>
<sql id="TProcessesDrillingJoins">
left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID
left join T_Processes_Blast c on a.HoleID = c.HoleID
left join T_Processes_BlastDesign_Volume d on a.StopeName=d.StopeName and a.StepName=d.StepName and a.BlastAreaName=d.BlastAreaName
</sql>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT
a.Uid,
a.HoleID,
a.Depth,
a.RowSpace,
a.HoleSpace,
a.HoleBlastVolume,
b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace,
b.StepHeight
FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getPage列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT
<include refid="TProcessesDiggingHoleColumns"/>
<include refid="TProcessesBlastColumns"/>
<include refid="TProcessesBlastdesignVolumeColumns"/>
<include refid="TProcessesDrillingColumns"/>
FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 根据条件求和某字段 -->
<select id="getSumByCondition" resultType="Double">
SELECT
sum(${condition})
FROM T_Processes_Drilling a
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>