FinanceInfoMapper.xml
8.57 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
<?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.financeInfo.mapper.FinanceInfoMapper">
<resultMap type="FinanceInfo" id="FinanceInfoResult">
<result property="id" column="id" />
<result property="orgCode" column="org_code" />
<result property="ename" column="ename" />
<result property="year" column="year" />
<result property="operRev" column="operRev" />
<result property="operProfit" column="operProfit" />
<result property="totProfit" column="totProfit" />
<result property="netProfit" column="netProfit" />
<result property="totLiab" column="totLiab" />
<result property="totalEquity" column="totalEquity" />
<result property="totAssets" column="totAssets" />
<result property="source" column="source" />
<result property="userId" column="user_id" />
<result property="orgId" column="org_id" />
<result property="cmId" column="cm_id" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectFinanceInfoVo">
select id, org_code, ename, year, operRev, operProfit, totProfit, netProfit, totLiab, totalEquity, totAssets, source, user_id, org_id, cm_id, del_flag, create_time, create_by, update_time, update_by from finance_info
</sql>
<select id="selectFinanceInfoList" parameterType="FinanceInfo" resultMap="FinanceInfoResult">
<include refid="selectFinanceInfoVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="orgCode != null and orgCode != '' "> and org_code = #{orgCode}</if>
<if test="ename != null and ename != '' "> and ename = #{ename}</if>
<if test="year != null "> and year = #{year}</if>
<if test="operRev != null "> and operRev = #{operRev}</if>
<if test="operProfit != null "> and operProfit = #{operProfit}</if>
<if test="totProfit != null "> and totProfit = #{totProfit}</if>
<if test="netProfit != null "> and netProfit = #{netProfit}</if>
<if test="totLiab != null "> and totLiab = #{totLiab}</if>
<if test="totalEquity != null "> and totalEquity = #{totalEquity}</if>
<if test="totAssets != null "> and totAssets = #{totAssets}</if>
<if test="source != null and source != '' "> and source = #{source}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="cmId != null "> and cm_id = #{cmId}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
</where>
</select>
<select id="selectFinanceInfoById" parameterType="Long" resultMap="FinanceInfoResult">
<include refid="selectFinanceInfoVo"/>
where id = #{id}
</select>
<select id="getFinanceInfoSearchCount" parameterType="String" resultType="java.lang.Long">
SELECT
COUNT( DISTINCT org_code )
FROM
finance_info
WHERE
source = 1
AND user_id= #{id}
</select>
<insert id="insertFinanceInfo" parameterType="FinanceInfo" useGeneratedKeys="true" keyProperty="id">
insert into finance_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orgCode != null and orgCode != '' ">org_code,</if>
<if test="ename != null and ename != '' ">ename,</if>
<if test="year != null ">year,</if>
<if test="operRev != null ">operRev,</if>
<if test="operProfit != null ">operProfit,</if>
<if test="totProfit != null ">totProfit,</if>
<if test="netProfit != null ">netProfit,</if>
<if test="totLiab != null ">totLiab,</if>
<if test="totalEquity != null ">totalEquity,</if>
<if test="totAssets != null ">totAssets,</if>
<if test="source != null and source != '' ">source,</if>
<if test="userId != null ">user_id,</if>
<if test="orgId != null ">org_id,</if>
<if test="cmId != null ">cm_id,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
<if test="createTime != null ">create_time,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="updateTime != null ">update_time,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orgCode != null and orgCode != '' ">#{orgCode},</if>
<if test="ename != null and ename != '' ">#{ename},</if>
<if test="year != null ">#{year},</if>
<if test="operRev != null ">#{operRev},</if>
<if test="operProfit != null ">#{operProfit},</if>
<if test="totProfit != null ">#{totProfit},</if>
<if test="netProfit != null ">#{netProfit},</if>
<if test="totLiab != null ">#{totLiab},</if>
<if test="totalEquity != null ">#{totalEquity},</if>
<if test="totAssets != null ">#{totAssets},</if>
<if test="source != null and source != '' ">#{source},</if>
<if test="userId != null ">#{userId},</if>
<if test="orgId != null ">#{orgId},</if>
<if test="cmId != null ">#{cmId},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
</trim>
</insert>
<update id="updateFinanceInfo" parameterType="FinanceInfo">
update finance_info
<trim prefix="SET" suffixOverrides=",">
<if test="orgCode != null and orgCode != '' ">org_code = #{orgCode},</if>
<if test="ename != null and ename != '' ">ename = #{ename},</if>
<if test="year != null ">year = #{year},</if>
<if test="operRev != null ">operRev = #{operRev},</if>
<if test="operProfit != null ">operProfit = #{operProfit},</if>
<if test="totProfit != null ">totProfit = #{totProfit},</if>
<if test="netProfit != null ">netProfit = #{netProfit},</if>
<if test="totLiab != null ">totLiab = #{totLiab},</if>
<if test="totalEquity != null ">totalEquity = #{totalEquity},</if>
<if test="totAssets != null ">totAssets = #{totAssets},</if>
<if test="source != null and source != '' ">source = #{source},</if>
<if test="userId != null ">user_id = #{userId},</if>
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="cmId != null ">cm_id = #{cmId},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteFinanceInfoById" parameterType="Long">
delete from finance_info where id = #{id}
</delete>
<delete id="deleteFinanceInfoByIds" parameterType="String">
delete from finance_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>