中扬CRM客户关系管理系统
#
LSH
2023-12-02 afa3bc1e2f39f66f59ee9b15d6af16593acdc9a4
src/main/resources/mapper/CompanyMoneyMapper.xml
@@ -15,19 +15,45 @@
        <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}
        <if test="userId != null">
            and user_id = #{userId}
        </if>
    </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}
        <if test="userId != null">
            and user_id = #{userId}
        </if>
    </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>
    <update id="updateMoneyCopyByid2">
        update man_company_money_copy set status2 = 2 where id = #{id}
    </update>
</mapper>