PiccErrOrderMapper.xml
7.25 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
<?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.piccErrOrder.mapper.PiccErrOrderMapper">
<resultMap type="PiccErrOrder" id="PiccErrOrderResult">
<result property="id" column="id" />
<result property="orderNum" column="orderNum" />
<result property="enterpriseName" column="enterpriseName" />
<result property="country" column="country" />
<result property="address" column="address" />
<result property="regNo" column="regNo" />
<result property="taxNo" column="taxNo" />
<result property="affiliation" column="affiliation" />
<result property="reportType" column="reportType" />
<result property="orderType" column="orderType" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="limitnum" column="limitnum" />
<result property="affiliationAll" column="affiliation_all" />
</resultMap>
<sql id="selectPiccErrOrderVo">
select id, orderNum, enterpriseName, country, address, regNo, taxNo, affiliation, reportType, orderType, status, create_time, update_time,limitnum,affiliation_all from picc_err_order
</sql>
<select id="selectPiccErrOrderList" parameterType="PiccErrOrder" resultMap="PiccErrOrderResult">
<include refid="selectPiccErrOrderVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="orderNum != null and orderNum != '' "> and orderNum like concat('%',#{orderNum},'%')</if>
<if test="enterpriseName != null and enterpriseName != '' "> and enterpriseName like concat('%',#{enterpriseName},'%')</if>
<if test="country != null and country != '' "> and country like concat('%', #{country},'%')</if>
<if test="address != null and address != '' "> and address = #{address}</if>
<if test="regNo != null and regNo != '' "> and regNo = #{regNo}</if>
<if test="taxNo != null and taxNo != '' "> and taxNo = #{taxNo}</if>
<if test="affiliation != null and affiliation != '' "> and affiliation like concat('%',#{affiliation},'%')</if>
<if test="reportType != null and reportType != '' "> and reportType = #{reportType}</if>
<if test="orderType != null and orderType != '' "> and orderType = #{orderType}</if>
<if test="status != null and status != '' "> and status = #{status}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectPiccErrOrderById" parameterType="Integer" resultMap="PiccErrOrderResult">
<include refid="selectPiccErrOrderVo"/>
where id = #{id}
</select>
<insert id="insertPiccErrOrder" parameterType="PiccErrOrder" useGeneratedKeys="true" keyProperty="id">
insert into picc_err_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNum != null and orderNum != '' ">orderNum,</if>
<if test="enterpriseName != null and enterpriseName != '' ">enterpriseName,</if>
<if test="country != null and country != '' ">country,</if>
<if test="address != null and address != '' ">address,</if>
<if test="regNo != null and regNo != '' ">regNo,</if>
<if test="taxNo != null and taxNo != '' ">taxNo,</if>
<if test="affiliation != null and affiliation != '' ">affiliation,</if>
<if test="reportType != null and reportType != '' ">reportType,</if>
<if test="orderType != null and orderType != '' ">orderType,</if>
<if test="status != null and status != '' ">status,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateTime != null ">update_time,</if>
<if test="limitnum != null and limitnum != '' ">limitnum,</if>
<if test="affiliationAll != null and affiliationAll != '' ">affiliation_all,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNum != null and orderNum != '' ">#{orderNum},</if>
<if test="enterpriseName != null and enterpriseName != '' ">#{enterpriseName},</if>
<if test="country != null and country != '' ">#{country},</if>
<if test="address != null and address != '' ">#{address},</if>
<if test="regNo != null and regNo != '' ">#{regNo},</if>
<if test="taxNo != null and taxNo != '' ">#{taxNo},</if>
<if test="affiliation != null and affiliation != '' ">#{affiliation},</if>
<if test="reportType != null and reportType != '' ">#{reportType},</if>
<if test="orderType != null and orderType != '' ">#{orderType},</if>
<if test="status != null and status != '' ">#{status},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="limitnum != null and limitnum != ''">#{limitnum},</if>
<if test="affiliationAll != null and affiliationAll != '' ">#{affiliationAll},</if>
</trim>
</insert>
<update id="updatePiccErrOrder" parameterType="PiccErrOrder">
update picc_err_order
<trim prefix="SET" suffixOverrides=",">
<if test="orderNum != null and orderNum != '' ">orderNum = #{orderNum},</if>
<if test="enterpriseName != null and enterpriseName != '' ">enterpriseName = #{enterpriseName},</if>
<if test="country != null and country != '' ">country = #{country},</if>
<if test="address != null and address != '' ">address = #{address},</if>
<if test="regNo != null and regNo != '' ">regNo = #{regNo},</if>
<if test="taxNo != null and taxNo != '' ">taxNo = #{taxNo},</if>
<if test="affiliation != null and affiliation != '' ">affiliation = #{affiliation},</if>
<if test="reportType != null and reportType != '' ">reportType = #{reportType},</if>
<if test="orderType != null and orderType != '' ">orderType = #{orderType},</if>
<if test="status != null and status != '' ">status = #{status},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePiccErrOrderById" parameterType="Integer">
delete from picc_err_order where id = #{id}
</delete>
<delete id="deletePiccErrOrderByIds" parameterType="String">
delete from picc_err_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>