TProcessesCrusherMapper.xml 1.9 KB
Newer Older
1 2 3 4
<?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.TProcessesCrusherMapper">

5 6 7 8 9 10 11 12 13 14 15 16 17

    <!-- 表和实体字段对照关系, 类似RestultMap -->
    <sql id="TProcessesCrusherColumns">
        a.Uid,
        a.CrusherStationID,
        a.CrushDate,
        a.Manager,
        a.Supervisor,
        a.TechDepart,
        a.Tabulator,
        a.EquipmentID,
        a.WorkType,
        a.WorkTime,
renchao's avatar
renchao committed
18
        /* a.Wcdw, 吨位  查吨位表中的吨位*/
19 20 21 22 23 24 25
        a.Price,
        a.TotalMoney,
        a.Bz,
        a.Tag
	</sql>

    <sql id="TWeightColumns">
renchao's avatar
renchao committed
26
        b.Wcdw, /*吨位  替换破碎工序中的吨位*/
27 28 29 30
	</sql>


    <sql id="TProcessesCrusherJoins">
renchao's avatar
renchao committed
31 32 33 34 35 36 37 38 39
        LEFT JOIN (
            SELECT
                Rq,
                SUM (Jz) AS Wcdw /*吨位  替换破碎工序中的吨位*/
            FROM
                T_Weight
            GROUP BY
            Rq
        ) b ON a.CrushDate = b.Rq
40 41 42
    </sql>

    <!-- 获取所有getPage列表 -->
renchao's avatar
renchao committed
43
    <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesCrusherVo">
44
        SELECT
renchao's avatar
renchao committed
45 46 47 48 49 50 51
        a.Uid,
        a.EquipmentID,
        a.WorkType,
        a.WorkTime,
        a.Price,
        a.TotalMoney,
        b.Wcdw
52 53 54 55 56 57 58
        FROM T_Processes_Crusher a
        <include refid="TProcessesCrusherJoins"/>
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

renchao's avatar
renchao committed
59 60

    <!-- 获取所有getPage列表 -->
renchao's avatar
renchao committed
61
    <select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesCrusherVo">
renchao's avatar
renchao committed
62 63 64 65 66 67 68 69 70 71
        SELECT
        <include refid="TWeightColumns"/>
        <include refid="TProcessesCrusherColumns"/>
        FROM T_Processes_Crusher a
        <include refid="TProcessesCrusherJoins"/>
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

72
</mapper>