zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
<?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.changhong.epc.parsing.mapper.tenant.asset.FixedSummaryMapper">
 
    <sql id="field">
        id,useDepartment,originalMoney,cumulativeDepreciation,currentDepreciation
        ,netMoney,countingState,calculationData,bookkeepingState,bookkeepingData
        ,data_start,ins_p,ins_t,upd_p,upd_t,calculationPeriod,accountingTime,number
    </sql>
 
    <select id="getMaxDateFixedSummary" parameterType="com.changhong.epc.bean.tenant.asset.FixedSummary" resultType="com.changhong.epc.bean.tenant.asset.FixedSummary">
        select
            <include refid="field"/>
        from epc_fixed_summary_{rule}
        where useDepartment = #{useDepartment}
        and data_start = 0
        order by calculationPeriod desc
        limit 1
    </select>
 
    <update id="updateFixedSummary" parameterType="com.changhong.epc.bean.tenant.asset.FixedSummary" >
        update epc_fixed_summary_{rule}
        <set>
            <if test="number != null">
                number = #{number},
            </if>
            <if test="orderCode != null">
                orderCode = #{orderCode},
            </if>
            <if test="currentDepreciation != null">
                currentDepreciation = #{currentDepreciation},
            </if>
            <if test="countingState != null">
                countingState = #{countingState},
            </if>
            <if test="bookkeepingState != null">
                bookkeepingState = #{bookkeepingState},
            </if>
            <if test="bookkeepingData != null">
                bookkeepingData = #{bookkeepingData},
            </if>
        </set>
        where useDepartment = #{useDepartment}
        and calculationPeriod = #{calculationPeriod}
    </update>
 
</mapper>