xuhy
10 天以前 6a298ac3319fa95cfe96cbab90983b2253e13dc2
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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.ruoyi.system.mapper.YcFinancialManagementMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.YcFinancialManagement">
        <id column="id" property="id" />
        <result column="province_name" property="provinceName" />
        <result column="province_code" property="provinceCode" />
        <result column="city_name" property="cityName" />
        <result column="city_code" property="cityCode" />
        <result column="type_id" property="typeId" />
        <result column="pay_money" property="payMoney" />
        <result column="pay_time" property="payTime" />
        <result column="pay_remark" property="payRemark" />
        <result column="pay_voucher" property="payVoucher" />
        <result column="revenue_type" property="revenueType" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, province_name,province_code, city_name,city_code, type_id, pay_money, pay_time, pay_remark, pay_voucher,revenue_type, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.YcFinancialManagementVO">
        SELECT
            fm.id, fm.province_name,fm.province_code, fm.city_name,fm.city_code, fm.type_id, fm.pay_money, fm.pay_time, fm.pay_remark,
            fm.pay_voucher,fm.revenue_type, fm.create_time, fm.update_time, fm.create_by, fm.update_by, fm.disabled, ty.type_name, ty.revenue_type
        FROM yc_financial_management fm
        LEFT JOIN yc_revenue_expenditure_type ty ON fm.type_id = ty.id
        <where>
            <if test="query.provinceOrCityCode != null and query.provinceOrCityCode != ''">
                AND (fm.province_code = #{query.provinceOrCityCode} OR fm.city_code = #{query.provinceOrCityCode})
            </if>
            <if test="query.revenueType != null">
                AND ty.revenue_type = #{query.revenueType}
            </if>
            <if test="query.typeId != null">
                AND ty.type_id = #{query.typeId}
            </if>
            <if test="query.updateBy != null and query.updateBy != ''">
                AND fm.update_by LIKE CONCAT('%',#{query.updateBy},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND fm.update_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            AND fm.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY fm.create_time DESC
    </select>
    <select id="financialManagementExport" resultType="com.ruoyi.system.export.YcFinancialManagementExport">
        SELECT
        fm.id, fm.province_name,fm.province_code, fm.city_name,fm.city_code, fm.type_id, fm.pay_money, fm.pay_time, fm.pay_remark,
        fm.pay_voucher,fm.revenue_type, fm.create_time, fm.update_time, fm.create_by, fm.update_by, fm.disabled, ty.type_name, ty.revenue_type
        FROM yc_financial_management fm
        LEFT JOIN yc_revenue_expenditure_type ty ON fm.type_id = ty.id
        <where>
            <if test="query.provinceOrCityCode != null and query.provinceOrCityCode != ''">
                AND (fm.province_code = #{query.provinceOrCityCode} OR fm.city_code = #{query.provinceOrCityCode})
            </if>
            <if test="query.revenueType != null">
                AND ty.revenue_type = #{query.revenueType}
            </if>
            <if test="query.typeId != null">
                AND ty.type_id = #{query.typeId}
            </if>
            <if test="query.updateBy != null and query.updateBy != ''">
                AND fm.update_by LIKE CONCAT('%',#{query.updateBy},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND fm.update_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            AND fm.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY fm.create_time DESC
    </select>
 
</mapper>