BAutoReportFinanceMapper.xml
3.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
<?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.bAutoReportFinance.mapper.BAutoReportFinanceMapper">
<resultMap type="BAutoReportFinance" id="BAutoReportFinanceResult">
<result property="id" column="id" />
<result property="ename" column="ename" />
<result property="type" column="type" />
<result property="curYear" column="cur_year" />
<result property="jsonStr" column="jsonStr" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBAutoReportFinanceVo">
select id, ename, type, cur_year, jsonStr, create_time from b_auto_report_finance
</sql>
<select id="selectBAutoReportFinanceList" parameterType="BAutoReportFinance" resultMap="BAutoReportFinanceResult">
<include refid="selectBAutoReportFinanceVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="ename != null and ename != '' "> and ename = #{ename}</if>
<if test="type != null and type != '' "> and type = #{type}</if>
<if test="curYear != null "> and cur_year = #{curYear}</if>
<if test="jsonStr != null and jsonStr != '' "> and jsonStr = #{jsonStr}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
</select>
<select id="selectBAutoReportFinanceById" parameterType="Integer" resultMap="BAutoReportFinanceResult">
<include refid="selectBAutoReportFinanceVo"/>
where id = #{id}
</select>
<insert id="insertBAutoReportFinance" parameterType="BAutoReportFinance" useGeneratedKeys="true" keyProperty="id">
insert into b_auto_report_finance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename,</if>
<if test="type != null and type != '' ">type,</if>
<if test="curYear != null ">cur_year,</if>
<if test="jsonStr != null and jsonStr != '' ">jsonStr,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">#{ename},</if>
<if test="type != null and type != '' ">#{type},</if>
<if test="curYear != null ">#{curYear},</if>
<if test="jsonStr != null and jsonStr != '' ">#{jsonStr},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateBAutoReportFinance" parameterType="BAutoReportFinance">
update b_auto_report_finance
<trim prefix="SET" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename = #{ename},</if>
<if test="type != null and type != '' ">type = #{type},</if>
<if test="curYear != null ">cur_year = #{curYear},</if>
<if test="jsonStr != null and jsonStr != '' ">jsonStr = #{jsonStr},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBAutoReportFinanceById" parameterType="Integer">
delete from b_auto_report_finance where id = #{id}
</delete>
<delete id="deleteBAutoReportFinanceByIds" parameterType="String">
delete from b_auto_report_finance where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>