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
<?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.TProcessesBlastMapper">
<select id="getNewPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
select
a.Uid,
a.BlastPeople,
a.CheckHoleDate,
a.CheckHolePeople,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.Bz,
a.Tag,
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,
c.BlastDate,
c.Depth
from T_Processes_Blast a
left join T_Processes_Drilling c on c.Uid = a.Uid
left join T_Processes_BlastDesign_Hole b on b.Uid = c.Uid
where 1=1
<if test="params.blastDate != null and params.blastDate != ''">
and Convert(varchar(10),c.BlastDate,120) <![CDATA[ = ]]> #{params.blastDate}
</if>
</select>
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesBlastColumns">
a.Uid,
a.BlastPeople,
a.CheckHoleDate,
a.CheckHolePeople,
a.Manager,
a.Supervisor,
a.TechDepart,
a.Tabulator,
a.Bz,
a.Tag
</sql>
<sql id="TProcessesBlastdesignColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 -->
</sql>
<sql id="TProcessesDrillingColumns">
c.BlastDate,
c.Depth,
</sql>
<sql id="TProcessesDrillingJoins">
left join T_Processes_Drilling c on a.Uid = c.Uid
</sql>
<sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on c.Uid = b.Uid
</sql>
<!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT
a.Uid,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume,
b.depth AS DesignDepth,
c.Depth
FROM T_Processes_Blast a
<include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
<!-- 获取所有getByUid列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT
<include refid="TProcessesBlastdesignColumns"/>
<include refid="TProcessesDrillingColumns"/>
<include refid="TProcessesBlastColumns"/>
FROM T_Processes_Blast a
<include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>