EnterpriseInfoMapper.xml
11.8 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?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.web.controller.business.mapper.EnterpriseInfoMapper">
<resultMap type="EnterpriseInfo" id="EnterpriseInfoResult">
<result property="id" column="id" />
<result property="ename" column="ename" />
<result property="creditCode" column="credit_code" />
<result property="legalpersonName" column="legalperson_name" />
<result property="estiblishTime" column="estiblish_time" />
<result property="regCapital" column="reg_capital" />
<result property="regInstitute" column="reg_institute" />
<result property="regStatus" column="reg_status" />
<result property="businessScope" column="business_scope" />
<result property="enterpriseAddress" column="enterprise_address" />
<result property="menlei" column="menlei" />
<result property="regLocation" column="reg_location" />
<result property="dataStatus" column="data_status" />
<result property="creditFraction" column="credit_fraction" />
<result property="creditLevel" column="credit_level" />
<result property="industryName" column="industry_name" />
<result property="industry" column="industry" />
<result property="regStatusCode" column="reg_status_code" />
<result property="newRegCapital" column="new_reg_capital" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEnterpriseInfoVo">
select id, ename, credit_code, legalperson_name, estiblish_time, reg_capital, reg_institute, reg_status, business_scope, enterprise_address, menlei, reg_location, data_status, credit_fraction, credit_level,industry_name,industry,reg_status_code, new_reg_capital,create_time, update_time from enterprise_info
</sql>
<select id="selectEnterpriseInfoList" parameterType="EnterpriseInfo" resultMap="EnterpriseInfoResult">
<!-- <include refid="selectEnterpriseInfoVo"/>-->
select
a.id,
a.ename,
a.credit_code,
a.legalperson_name,
a.estiblish_time,
a.reg_capital,
a.reg_institute,
a.reg_status,
a.business_scope,
a.enterprise_address,
a.menlei,
a.reg_location,
a.data_status,
a.credit_fraction,
a.credit_level,
a.industry_name,
a.industry,
a.reg_status_code,
a.new_reg_capital,
a.create_time,
a.update_time
from
enterprise_info a
<if test="tagName != null and tagName != ''">
join enterprise_tags b on a.credit_code = b.enterprise_code
</if>
<!--(科技型中小企业: 1, 高新技术企业:2, 瞪羚企业:3, 独角兽企业:4, 专精特新小巨人企业: 5)-->
<if test="tableType != null and tableType !=''">
join
<choose>
<when test="tableType == 1"> tech_medium_enterprise t on a.credit_code = t.credit_code</when>
<when test="tableType == 2"> high_tech_enterprise h on a.credit_code = h.credit_code</when>
<when test="tableType == 3"> gazelle_enterprise g on a.credit_code = g.credit_code</when>
<when test="tableType == 4"> unicorn_enterprise u on a.credit_code = u.credit_code</when>
<when test="tableType == 5"> giant_enterprise g on a.credit_code = g.credit_code</when>
<otherwise></otherwise>
</choose>
</if>
<where>
<if test="ename != null and ename != ''"> and a.ename like concat('%', #{ename}, '%')</if>
<if test="creditCode != null and creditCode != ''"> and a.credit_code = #{creditCode}</if>
<if test="legalpersonName != null and legalpersonName != ''"> and a.legalperson_name like concat('%', #{legalpersonName}, '%')</if>
<if test="estiblishTimeStart != null and estiblishTimeStart != ''">
and a.estiblish_time::date >= to_date(#{a.estiblishTimeStart},'yyyy-MM-dd')
</if>
<if test="estiblishTimeEnd != null and estiblishTimeEnd != ''">
and a.estiblish_time::Date <= to_date(#{a.estiblishTimeEnd},'yyyy-MM-dd')
</if>
<!-- <if test="regCapital != null and regCapital != ''"> and reg_capital = #{regCapital}</if>-->
<if test="regCapitalStart != null ">
and a.reg_capital > #{regCapitalStart}
</if>
<if test="regCapitalEnd != null ">
and a.reg_capital <= #{regCapitalEnd}
</if>
<!-- <if test="creditFraction != null and creditFraction != ''"> and credit_fraction = #{creditFraction}</if>-->
<if test="creditFractionStart != null ">
and a.credit_fraction > #{creditFractionStart}
</if>
<if test="creditFractionEnd != null ">
and a.credit_fraction <= #{creditFractionEnd}
</if>
<if test="regInstitute != null and regInstitute != ''"> and a.reg_institute = #{regInstitute}</if>
<if test="regStatus != null and regStatus != ''"> and a.reg_status = #{regStatus}</if>
<if test="businessScope != null and businessScope != ''"> and a.business_scope = #{businessScope}</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''"> and a.enterprise_address = #{enterpriseAddress}</if>
<if test="menlei != null and menlei != ''"> and a.menlei = #{menlei}</if>
<if test="regLocation != null and regLocation != ''"> and a.reg_location = #{regLocation}</if>
<if test="dataStatus != null and dataStatus != ''"> and a.data_status = #{dataStatus}</if>
<if test="creditLevel != null and creditLevel != ''"> and a.credit_level = #{creditLevel}</if>
<if test="industryName != null and industryName != ''"> and a.industry_name = #{industryName}</if>
<if test="industry != null and industry != ''"> and a.industry = #{industry}</if>
<if test="regStatusCode != null and regStatusCode != ''"> and a.reg_status_code = #{regStatusCode}</if>
<if test="newRegCapital != null and newRegCapital != ''"> and a.new_reg_capital = #{newRegCapital}</if>
<if test="tagName != null and tagName != ''"> and b.tag_name = #{tagName}</if>
</where>
</select>
<select id="selectEnterpriseInfoById" parameterType="Long" resultMap="EnterpriseInfoResult">
</select>
<insert id="insertEnterpriseInfo" parameterType="EnterpriseInfo">
insert into enterprise_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="ename != null">ename,</if>
<if test="creditCode != null">credit_code,</if>
<if test="legalpersonName != null">legalperson_name,</if>
<if test="estiblishTime != null">estiblish_time,</if>
<if test="regCapital != null">reg_capital,</if>
<if test="regInstitute != null">reg_institute,</if>
<if test="regStatus != null">reg_status,</if>
<if test="businessScope != null">business_scope,</if>
<if test="enterpriseAddress != null">enterprise_address,</if>
<if test="menlei != null">menlei,</if>
<if test="regLocation != null">reg_location,</if>
<if test="dataStatus != null">data_status,</if>
<if test="creditFraction != null">credit_fraction,</if>
<if test="creditLevel != null">credit_level,</if>
<if test="industryName != null">industry_name,</if>
<if test="industry != null">industry,</if>
<if test="regStatusCode != null">reg_status_code,</if>
<if test="newRegCapital != null">new_reg_capital,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="ename != null">#{ename},</if>
<if test="creditCode != null">#{creditCode},</if>
<if test="legalpersonName != null">#{legalpersonName},</if>
<if test="estiblishTime != null">#{estiblishTime},</if>
<if test="regCapital != null">#{regCapital},</if>
<if test="regInstitute != null">#{regInstitute},</if>
<if test="regStatus != null">#{regStatus},</if>
<if test="businessScope != null">#{businessScope},</if>
<if test="enterpriseAddress != null">#{enterpriseAddress},</if>
<if test="menlei != null">#{menlei},</if>
<if test="regLocation != null">#{regLocation},</if>
<if test="dataStatus != null">#{dataStatus},</if>
<if test="creditFraction != null">#{creditFraction},</if>
<if test="creditLevel != null">#{creditLevel},</if>
<if test="industryName != null">#{industry_name},</if>
<if test="industry != null">#{industry},</if>
<if test="regStatusCode != null">#{reg_status_code},</if>
<if test="newRegCapital != null">#{new_reg_capital},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEnterpriseInfo" parameterType="EnterpriseInfo">
update enterprise_info
<trim prefix="SET" suffixOverrides=",">
<if test="ename != null">ename = #{ename},</if>
<if test="creditCode != null">credit_code = #{creditCode},</if>
<if test="legalpersonName != null">legalperson_name = #{legalpersonName},</if>
<if test="estiblishTime != null">estiblish_time = #{estiblishTime},</if>
<if test="regCapital != null">reg_capital = #{regCapital},</if>
<if test="regInstitute != null">reg_institute = #{regInstitute},</if>
<if test="regStatus != null">reg_status = #{regStatus},</if>
<if test="businessScope != null">business_scope = #{businessScope},</if>
<if test="enterpriseAddress != null">enterprise_address = #{enterpriseAddress},</if>
<if test="menlei != null">menlei = #{menlei},</if>
<if test="regLocation != null">reg_location = #{regLocation},</if>
<if test="dataStatus != null">data_status = #{dataStatus},</if>
<if test="creditFraction != null">credit_fraction = #{creditFraction},</if>
<if test="creditLevel != null">credit_level = #{creditLevel},</if>
<if test="industryName != null">industry_name = #{industryName},</if>
<if test="industry != null">industry = #{industry},</if>
<if test="regStatusCode != null">reg_status_code = #{regStatusCode},</if>
<if test="newRegCapital != null">new_reg_capital = #{newRegCapital},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEnterpriseInfoById" parameterType="Long">
delete from enterprise_info where id = #{id}
</delete>
<delete id="deleteEnterpriseInfoByIds" parameterType="String">
delete from enterprise_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>