OrderMapper.xml
4.89 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
<?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.OrderMapper">
<resultMap type="Order" id="OrderResult">
<result property="id" column="id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="userId" column="user_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="reportProgress" column="report_progress" />
<result property="docUrl" column="doc_url" />
<result property="pdfUrl" column="pdf_url" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="finishTime" column="finish_time" />
</resultMap>
<sql id="selectOrderVo">
select id, enterprise_name, user_id, enterprise_code, report_progress, doc_url, pdf_url, create_time, update_time, finish_time from credit_order
</sql>
<select id="selectOrderList" parameterType="Order" resultMap="OrderResult">
<include refid="selectOrderVo"/>
<where>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = #{enterpriseCode}</if>
<if test="reportProgress != null and reportProgress != ''"> and report_progress = #{reportProgress}</if>
<if test="docUrl != null and docUrl != ''"> and doc_url = #{docUrl}</if>
<if test="pdfUrl != null and pdfUrl != ''"> and pdf_url = #{pdfUrl}</if>
<if test="beginTime != null">and create_time>= to_date(#{beginTime},'yyyy-MM-dd')</if>
<if test="endTime != null">and create_time<=to_date(#{endTime},'yyyy-MM-dd')</if>
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
</where>
</select>
<select id="selectOrderById" parameterType="Long" resultMap="OrderResult">
</select>
<insert id="insertOrder" parameterType="Order">
insert into credit_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="userId != null">user_id,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="reportProgress != null">report_progress,</if>
<if test="docUrl != null">doc_url,</if>
<if test="pdfUrl != null">pdf_url,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="finishTime != null">finish_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="userId != null">#{userId},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="reportProgress != null">#{reportProgress},</if>
<if test="docUrl != null">#{docUrl},</if>
<if test="pdfUrl != null">#{pdfUrl},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="finishTime != null">#{finishTime},</if>
</trim>
</insert>
<update id="updateOrder" parameterType="Order">
update credit_order
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="reportProgress != null">report_progress = #{reportProgress},</if>
<if test="docUrl != null">doc_url = #{docUrl},</if>
<if test="pdfUrl != null">pdf_url = #{pdfUrl},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="finishTime != null">finish_time = #{finishTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderById" parameterType="Long">
delete from credit_order where id = #{id}
</delete>
<delete id="deleteOrderByIds" parameterType="String">
delete from credit_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>