liurunyu
2025-02-07 4b1d11a68a2d04a0b9bbf89d9368ca563d932687
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
<?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="com.dy.pipIrrGlobal.daoSpecial.SpecialMapper">
 
    <select id="selectStealTotal" parameterType="java.util.Map" resultType="java.lang.Long">
        select
        count(*)
        from rm_open_close_valve_history mTb
        left join pr_intake piTb on piTb.id = mTb.intake_id
        left join se_client scTb on scTb.id = mTb.client_id
        <where>
            <if test = "fromDate != null">
                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP}
            </if>
            <if test = "intakeNum != null and intakeNum != '' ">
                and piTb.name = #{intakeNum, jdbcType=VARCHAR}
            </if>
            <if test = "clientNum != null and clientNum != '' ">
                and scTb.clientNum = #{clientNum, jdbcType=VARCHAR}
            </if>
            <if test = "clientName != null and clientName != '' ">
                and scTb.name = #{clientName, jdbcType=VARCHAR}
            </if>
        </where>
    </select>
 
    <select id="selectStealSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voSpecial.VoSteal">
        select mTb.id as id, mTb.intake_id as intakeId, mTb.client_id as clientId,
        piTb.name as intakeNum,
        scTb.name as clientName, scTb.clientNum as clientNum,
        mTb.op_dt as openDt, mTb.op_type as opType, mTb.op_total_amount as openTotalAmount, mTb.op_remain_money as openRemainMoney,
        mTb.cl_dt as closeDt, mTb.cl_type as clType, mTb.cl_total_amount as closeTotalAmount, mTb.cl_remain_money as closeRemainMoney,
        mTb.cl_this_amount as thisAmount, mTb.cl_this_money as thisMoney, mTb.cl_this_time as thisTime
        from rm_open_close_valve_history mTb
        left join pr_intake piTb on piTb.id = mTb.intake_id
        left join se_client scTb on scTb.id = mTb.client_id
        <where>
            <if test = "fromDate != null">
                mTb.cl_dt <![CDATA[>=]]> #{fromDate, javaType=DATE, jdbcType=TIMESTAMP}
            </if>
            <if test = "intakeNum != null and intakeNum != '' ">
                and piTb.name = #{intakeNum, jdbcType=VARCHAR}
            </if>
            <if test = "clientNum != null and clientNum != '' ">
                and scTb.clientNum = #{clientNum, jdbcType=VARCHAR}
            </if>
            <if test = "clientName != null and clientName != '' ">
                and scTb.name = #{clientName, jdbcType=VARCHAR}
            </if>
        </where>
        order by mTb.id DESC
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer, jdbcType=INTEGER}, #{count,javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
</mapper>