IndustryStandardMapper.xml
6.33 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?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.lhcredit.project.business.reportTable.mapper.IndustryMapper">
<resultMap type="com.lhcredit.project.business.reportMake.industry.IndustryStandard" id="IndustryStandardMap">
<result column="id" property="id"/>
<result column="industry_name" property="industryName"/>
<result column="industry_size" property="industrySize"/>
<result column="name" property="name"/>
<result column="good_value" property="goodValue"/>
<result column="a_good_value" property="aGoodValue"/>
<result column="mean_value" property="meanValue"/>
<result column="low_value" property="lowValue"/>
<result column="difference_value" property="differenceValue"/>
<result column="year" property="year"/>
</resultMap>
<resultMap type="com.lhcredit.project.business.reportMake.industry.IndustryRelation" id="IndustryRelationMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="originalName" column="original_name" jdbcType="VARCHAR"/>
<result property="contrastName" column="contrast_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="selectIndustryStandardVo">
select id, industry_name, industry_size, `name`, good_value, a_good_value, mean_value, low_value, difference_value ,`year` from industry_standard_2022
</sql>
<sql id="selectIndustryRelationVo">
select id, original_name, contrast_name,year from industry_relation_2022
</sql>
<!--通过实体作为筛选条件查询-->
<select id="industryStandardAueryAll" parameterType="com.lhcredit.project.business.reportMake.industry.IndustryStandard" resultMap="IndustryStandardMap">
<include refid="selectIndustryStandardVo"/>
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="null!=industryNameList and industryNameList.size()!=0">
and industry_name in
<foreach collection="industryNameList" item="item" index="index" open="(" separator="," close=")">
#{item.contrastName}
</foreach>
</if>
<if test="industrySize != null and industrySize != ''">
and industry_size = #{industrySize}
</if>
<if test="name != null and name != ''">
and name = #{name}
</if>
<if test="goodValue != null">
and good_value = #{goodValue}
</if>
<if test="aGoodValue != null">
and a_good_value = #{aGoodValue}
</if>
<if test="meanValue != null">
and mean_value = #{meanValue}
</if>
<if test="lowValue != null">
and low_value = #{lowValue}
</if>
<if test="differenceValue != null">
and difference_value = #{differenceValue}
</if>
<if test="year != null">
and year = #{year}
</if>
<if test="years != null">
and year in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="remark != null and remark != ''">
and YEAR=(SELECT YEAR FROM industry_standard_2022 ORDER BY YEAR DESC LIMIT 1)
</if>
</where>
</select>
<select id="industryStandardAueryAll2" parameterType="com.lhcredit.project.business.reportMake.industry.IndustryStandard" resultMap="IndustryStandardMap">
<include refid="selectIndustryStandardVo"/>
where
name in("营业总收入增长率(%)","净资产收益率(%)","总资产周转率(次)","资产负债率(%)")
<if test="null!=industryNameList and industryNameList.size()!=0">
and industry_name in
<foreach collection="industryNameList" item="item" index="index" open="(" separator="," close=")">
#{item.contrastName}
</foreach>
</if>
<if test="industrySize != null and industrySize != ''">
and industry_size = #{industrySize}
</if>
<if test="name != null and name != ''">
and name = #{name}
</if>
<if test="year != null and year != ''">
and year = #{year}
</if>
</select>
<!--通过实体作为筛选条件查询-->
<select id="industryRelationByAll" parameterType="com.lhcredit.project.business.reportMake.industry.IndustryRelation" resultMap="IndustryRelationMap">
<include refid="selectIndustryRelationVo"/>
<where>
contrast_name IS NOT NULL and contrast_name!=""
<if test="id != null">
and id = #{id}
</if>
<if test="originalName != null and originalName != ''">
and original_name = #{originalName}
</if>
<if test="contrastName != null and contrastName != ''">
and contrast_name = #{contrastName}
</if>
<if test="remark != null and remark != ''">
and YEAR=(SELECT YEAR FROM industry_relation_2022 ORDER BY YEAR DESC LIMIT 1)
</if>
<if test="years != null and years != ''">
and year in ${years}
</if>
</where>
</select>
<!--通过实体作为筛选条件查询-->
<select id="industryRelationByNew" parameterType="com.lhcredit.project.business.reportMake.industry.IndustryRelation" resultMap="IndustryRelationMap">
<include refid="selectIndustryRelationVo"/>
<where>
contrast_name IS NOT NULL and contrast_name!=""
<if test="id != null">
and id = #{id}
</if>
<if test="originalName != null and originalName != ''">
and original_name = #{originalName}
</if>
<if test="contrastName != null and contrastName != ''">
and contrast_name = #{contrastName}
</if>
<if test="years != null and years != ''">
and year in ${years}
</if>
</where>
</select>
</mapper>