TProcessesDrillingMapper.xml 3.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?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.Manager,
        a.Supervisor,
        a.TechDepart,
        a.Tabulator,
        a.EquipmentID,
        a.Driver,
        a.StartTime,
        a.EndTime,
        a.WorkTime,
renchao's avatar
renchao committed
18
        a.HoleBlastVolume,
19 20 21 22 23 24 25 26 27
        a.Depth,
        a.RowSpace,
        a.HoleSpace,
        a.Azimuth,
        a.Inclination,
        a.Aperture,
        a.x,
        a.y,
        a.z,
renchao's avatar
renchao committed
28
        a.BlastDate,
29 30 31
        a.Operator,
        a.Accepter,
        a.Bz,
renchao's avatar
renchao committed
32
        a.Tag
33 34
	</sql>

renchao's avatar
renchao committed
35 36 37 38 39 40 41
    <sql id="TProcessesBlastDesignHoleColumns">
        b.StopeName,
        b.StepName,
        b.BlastAreaName,
        b.BlastHoleID AS HoleId,
        b.DrillingDate,

renchao's avatar
renchao committed
42 43 44 45 46 47
        b.Depth AS DesignDepth,
        b.RowSpace AS DesignRowSpace,
        b.HoleSpace AS  DesignHoleSpace,
        b.Azimuth AS DesignAzimuth,
        b.Inclination AS DesignInclination,
        b.Aperture AS DesignAperture,
renchao's avatar
renchao committed
48
        b.StepHeight,
49 50
	</sql>

renchao's avatar
renchao committed
51 52 53 54

    <sql id="TProcessesBlastdesignVolumeColumns">
        d.BlastVolume,
        d.DesignDate,
55 56
	</sql>

renchao's avatar
renchao committed
57 58 59 60 61 62
    <sql id="TProcessesBlastDesignHoleJoins">
        left join T_Processes_BlastDesign_Hole b on a.Uid = b.Uid
    </sql>

    <sql id="TProcessesBlastDesignVolumeJoins">
        left join T_Processes_BlastDesign_Volume d on b.StopeName=d.StopeName and b.StepName=d.StepName and b.BlastAreaName=d.BlastAreaName
63 64 65 66 67
    </sql>

    <!-- 获取所有getPage列表 -->
    <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
        SELECT
renchao's avatar
renchao committed
68 69 70 71 72
        a.Uid,
        a.Depth,
        a.RowSpace,
        a.HoleSpace,
        a.HoleBlastVolume,
renchao's avatar
renchao committed
73
        b.BlastHoleID AS HoleId,
renchao's avatar
renchao committed
74 75 76 77
        b.Depth AS DesignDepth,
        b.RowSpace AS DesignRowSpace,
        b.HoleSpace AS  DesignHoleSpace,
        b.StepHeight
renchao's avatar
renchao committed
78
        FROM T_Processes_Drilling a
renchao's avatar
renchao committed
79 80
        <include refid="TProcessesBlastDesignHoleJoins"/>
        <include refid="TProcessesBlastDesignVolumeJoins"/>
81 82 83 84 85
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

renchao's avatar
renchao committed
86 87

    <!-- 获取所有getPage列表 -->
renchao's avatar
renchao committed
88
    <select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
renchao's avatar
renchao committed
89
        SELECT
renchao's avatar
renchao committed
90
        <include refid="TProcessesBlastDesignHoleColumns"/>
renchao's avatar
renchao committed
91 92 93
        <include refid="TProcessesBlastdesignVolumeColumns"/>
        <include refid="TProcessesDrillingColumns"/>
        FROM T_Processes_Drilling a
renchao's avatar
renchao committed
94 95
        <include refid="TProcessesBlastDesignHoleJoins"/>
        <include refid="TProcessesBlastDesignVolumeJoins"/>
renchao's avatar
renchao committed
96 97 98 99 100 101
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

    <!-- 根据条件求和某字段 -->
102 103 104
    <select id="getSumByCondition" resultType="Double">
        SELECT
        sum(${condition})
renchao's avatar
renchao committed
105
        FROM T_Processes_Drilling a
renchao's avatar
renchao committed
106
        <include refid="TProcessesBlastDesignHoleJoins"/>
107 108 109 110 111 112 113
        <where>
            ${ew.sqlSegment}
        </where>
    </select>


</mapper>