中扬CRM客户关系管理系统
#
LSH
2023-11-10 ddfd131179d3b074dd22f044dd0267c976143db6
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
<?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.zy.crm.manager.mapper.CompanyMoneyMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.CompanyMoney">
        <id column="id" property="id" />
        <result column="year" property="year" />
        <result column="receivables" property="receivables" />
        <result column="create_time" property="createTime" />
        <result column="user_id" property="userId" />
        <result column="update_time" property="updateTime" />
        <result column="update_user_id" property="updateUserId" />
        <result column="staff" property="staff" />
        <result column="complete" property="complete" />
        <result column="order_id" property="orderId" />
        <result column="actual_receipts" property="actualReceipts" />
        <result column="balance_now" property="balanceNow" />
        <result column="memo" property="memo" />
        <result column="status" property="status" />
        <result column="delivery_time" property="deliveryTime" />
        <result column="cstmr_name" property="cstmrName" />
        <result column="user_name" property="userName" />
        <result column="receivables_type" property="receivablesType" />
        <result column="receivables_type_name" property="receivablesTypeName" />
        <result column="cstmr_id" property="cstmrId" />
        <result column="status2" property="status2" />
 
    </resultMap>
 
    <select id="selectMoneyReceivablesAll" resultType="java.lang.Double">
        select sum(receivables) receivables from man_company_money
        where year(create_time) = #{year}
        and user_id = #{userId}
    </select>
 
    <select id="selectMoneyActualReceiptsAll" resultType="java.lang.Double">
        select sum(actual_receipts) actualReceipts from man_company_money
        where year(create_time) = #{year}
        and user_id = #{userId}
    </select>
 
    <select id="selectMoneyCopyAll" resultMap="BaseResultMap">
        select * from man_company_money_copy where status2 is null
    </select>
 
    <update id="updateMoneyCopyByid">
        update man_company_money_copy set status2 = 1 where id = #{id}
    </update>
 
</mapper>