|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
2
|
+<!DOCTYPE mapper
|
|
|
3
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
4
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
5
|
+<mapper namespace="com.smartSteward.mapper.gas.GasLicenseArchiveMapper">
|
|
|
6
|
+
|
|
|
7
|
+ <resultMap type="GasLicenseArchive" id="GasLicenseArchiveResult">
|
|
|
8
|
+ <result property="id" column="id" />
|
|
|
9
|
+ <result property="stationId" column="station_id" />
|
|
|
10
|
+ <result property="licenseNameCode" column="license_name_code" />
|
|
|
11
|
+ <result property="orgTypeCode" column="org_type_code" />
|
|
|
12
|
+ <result property="issuingAuthority" column="issuing_authority" />
|
|
|
13
|
+ <result property="certificateNumber" column="certificate_number" />
|
|
|
14
|
+ <result property="issueDate" column="issue_date" />
|
|
|
15
|
+ <result property="validDate" column="valid_date" />
|
|
|
16
|
+ <result property="isLongTerm" column="is_long_term" />
|
|
|
17
|
+ <result property="nextRenewalDate" column="next_renewal_date" />
|
|
|
18
|
+ <result property="nextAnnualReviewDate" column="next_annual_review_date" />
|
|
|
19
|
+ <result property="renewalRequirements" column="renewal_requirements" />
|
|
|
20
|
+ <result property="storageLocationCode" column="storage_location_code" />
|
|
|
21
|
+ <result property="certificateScanPath" column="certificate_scan_path" />
|
|
|
22
|
+ <result property="statusCode" column="status_code" />
|
|
|
23
|
+ <result property="operatorId" column="operator_id" />
|
|
|
24
|
+ <result property="operatorName" column="operator_name" />
|
|
|
25
|
+ <result property="operatedAt" column="operated_at" />
|
|
|
26
|
+ <result property="createdAt" column="created_at" />
|
|
|
27
|
+ <result property="updatedAt" column="updated_at" />
|
|
|
28
|
+ </resultMap>
|
|
|
29
|
+
|
|
|
30
|
+ <sql id="selectGasLicenseArchiveVo">
|
|
|
31
|
+ select id, station_id, license_name_code, org_type_code, issuing_authority, certificate_number, issue_date, valid_date, is_long_term, next_renewal_date, next_annual_review_date, renewal_requirements, storage_location_code, certificate_scan_path, status_code, operator_id, operator_name, operated_at, created_at, updated_at from gas_license_archive
|
|
|
32
|
+ </sql>
|
|
|
33
|
+
|
|
|
34
|
+ <select id="selectGasLicenseArchiveList" parameterType="GasLicenseArchive" resultMap="GasLicenseArchiveResult">
|
|
|
35
|
+ <include refid="selectGasLicenseArchiveVo"/>
|
|
|
36
|
+ <where>
|
|
|
37
|
+ <if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
38
|
+ <if test="licenseNameCode != null and licenseNameCode != ''"> and license_name_code = #{licenseNameCode}</if>
|
|
|
39
|
+ <if test="orgTypeCode != null and orgTypeCode != ''"> and org_type_code = #{orgTypeCode}</if>
|
|
|
40
|
+ <if test="issuingAuthority != null and issuingAuthority != ''"> and issuing_authority = #{issuingAuthority}</if>
|
|
|
41
|
+ <if test="certificateNumber != null and certificateNumber != ''"> and certificate_number = #{certificateNumber}</if>
|
|
|
42
|
+ <if test="issueDate != null "> and issue_date = #{issueDate}</if>
|
|
|
43
|
+ <if test="validDate != null "> and valid_date = #{validDate}</if>
|
|
|
44
|
+ <if test="isLongTerm != null "> and is_long_term = #{isLongTerm}</if>
|
|
|
45
|
+ <if test="nextRenewalDate != null "> and next_renewal_date = #{nextRenewalDate}</if>
|
|
|
46
|
+ <if test="nextAnnualReviewDate != null "> and next_annual_review_date = #{nextAnnualReviewDate}</if>
|
|
|
47
|
+ <if test="renewalRequirements != null and renewalRequirements != ''"> and renewal_requirements = #{renewalRequirements}</if>
|
|
|
48
|
+ <if test="storageLocationCode != null and storageLocationCode != ''"> and storage_location_code = #{storageLocationCode}</if>
|
|
|
49
|
+ <if test="certificateScanPath != null and certificateScanPath != ''"> and certificate_scan_path = #{certificateScanPath}</if>
|
|
|
50
|
+ <if test="statusCode != null and statusCode != ''"> and status_code = #{statusCode}</if>
|
|
|
51
|
+ <if test="operatorId != null "> and operator_id = #{operatorId}</if>
|
|
|
52
|
+ <if test="operatorName != null and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if>
|
|
|
53
|
+ <if test="operatedAt != null "> and operated_at = #{operatedAt}</if>
|
|
|
54
|
+ <if test="createdAt != null "> and created_at = #{createdAt}</if>
|
|
|
55
|
+ <if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
|
|
56
|
+ </where>
|
|
|
57
|
+ </select>
|
|
|
58
|
+
|
|
|
59
|
+ <select id="selectGasLicenseArchiveById" parameterType="Long" resultMap="GasLicenseArchiveResult">
|
|
|
60
|
+ <include refid="selectGasLicenseArchiveVo"/>
|
|
|
61
|
+ where id = #{id}
|
|
|
62
|
+ </select>
|
|
|
63
|
+
|
|
|
64
|
+ <insert id="insertGasLicenseArchive" parameterType="GasLicenseArchive" useGeneratedKeys="true" keyProperty="id">
|
|
|
65
|
+ insert into gas_license_archive
|
|
|
66
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
67
|
+ <if test="stationId != null">station_id,</if>
|
|
|
68
|
+ <if test="licenseNameCode != null and licenseNameCode != ''">license_name_code,</if>
|
|
|
69
|
+ <if test="orgTypeCode != null and orgTypeCode != ''">org_type_code,</if>
|
|
|
70
|
+ <if test="issuingAuthority != null and issuingAuthority != ''">issuing_authority,</if>
|
|
|
71
|
+ <if test="certificateNumber != null and certificateNumber != ''">certificate_number,</if>
|
|
|
72
|
+ <if test="issueDate != null">issue_date,</if>
|
|
|
73
|
+ <if test="validDate != null">valid_date,</if>
|
|
|
74
|
+ <if test="isLongTerm != null">is_long_term,</if>
|
|
|
75
|
+ <if test="nextRenewalDate != null">next_renewal_date,</if>
|
|
|
76
|
+ <if test="nextAnnualReviewDate != null">next_annual_review_date,</if>
|
|
|
77
|
+ <if test="renewalRequirements != null">renewal_requirements,</if>
|
|
|
78
|
+ <if test="storageLocationCode != null and storageLocationCode != ''">storage_location_code,</if>
|
|
|
79
|
+ <if test="certificateScanPath != null">certificate_scan_path,</if>
|
|
|
80
|
+ <if test="statusCode != null">status_code,</if>
|
|
|
81
|
+ <if test="operatorId != null">operator_id,</if>
|
|
|
82
|
+ <if test="operatorName != null">operator_name,</if>
|
|
|
83
|
+ <if test="operatedAt != null">operated_at,</if>
|
|
|
84
|
+ <if test="createdAt != null">created_at,</if>
|
|
|
85
|
+ <if test="updatedAt != null">updated_at,</if>
|
|
|
86
|
+ </trim>
|
|
|
87
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
88
|
+ <if test="stationId != null">#{stationId},</if>
|
|
|
89
|
+ <if test="licenseNameCode != null and licenseNameCode != ''">#{licenseNameCode},</if>
|
|
|
90
|
+ <if test="orgTypeCode != null and orgTypeCode != ''">#{orgTypeCode},</if>
|
|
|
91
|
+ <if test="issuingAuthority != null and issuingAuthority != ''">#{issuingAuthority},</if>
|
|
|
92
|
+ <if test="certificateNumber != null and certificateNumber != ''">#{certificateNumber},</if>
|
|
|
93
|
+ <if test="issueDate != null">#{issueDate},</if>
|
|
|
94
|
+ <if test="validDate != null">#{validDate},</if>
|
|
|
95
|
+ <if test="isLongTerm != null">#{isLongTerm},</if>
|
|
|
96
|
+ <if test="nextRenewalDate != null">#{nextRenewalDate},</if>
|
|
|
97
|
+ <if test="nextAnnualReviewDate != null">#{nextAnnualReviewDate},</if>
|
|
|
98
|
+ <if test="renewalRequirements != null">#{renewalRequirements},</if>
|
|
|
99
|
+ <if test="storageLocationCode != null and storageLocationCode != ''">#{storageLocationCode},</if>
|
|
|
100
|
+ <if test="certificateScanPath != null">#{certificateScanPath},</if>
|
|
|
101
|
+ <if test="statusCode != null">#{statusCode},</if>
|
|
|
102
|
+ <if test="operatorId != null">#{operatorId},</if>
|
|
|
103
|
+ <if test="operatorName != null">#{operatorName},</if>
|
|
|
104
|
+ <if test="operatedAt != null">#{operatedAt},</if>
|
|
|
105
|
+ <if test="createdAt != null">#{createdAt},</if>
|
|
|
106
|
+ <if test="updatedAt != null">#{updatedAt},</if>
|
|
|
107
|
+ </trim>
|
|
|
108
|
+ </insert>
|
|
|
109
|
+
|
|
|
110
|
+ <update id="updateGasLicenseArchive" parameterType="GasLicenseArchive">
|
|
|
111
|
+ update gas_license_archive
|
|
|
112
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
113
|
+ <if test="stationId != null">station_id = #{stationId},</if>
|
|
|
114
|
+ <if test="licenseNameCode != null and licenseNameCode != ''">license_name_code = #{licenseNameCode},</if>
|
|
|
115
|
+ <if test="orgTypeCode != null and orgTypeCode != ''">org_type_code = #{orgTypeCode},</if>
|
|
|
116
|
+ <if test="issuingAuthority != null and issuingAuthority != ''">issuing_authority = #{issuingAuthority},</if>
|
|
|
117
|
+ <if test="certificateNumber != null and certificateNumber != ''">certificate_number = #{certificateNumber},</if>
|
|
|
118
|
+ <if test="issueDate != null">issue_date = #{issueDate},</if>
|
|
|
119
|
+ <if test="validDate != null">valid_date = #{validDate},</if>
|
|
|
120
|
+ <if test="isLongTerm != null">is_long_term = #{isLongTerm},</if>
|
|
|
121
|
+ <if test="nextRenewalDate != null">next_renewal_date = #{nextRenewalDate},</if>
|
|
|
122
|
+ <if test="nextAnnualReviewDate != null">next_annual_review_date = #{nextAnnualReviewDate},</if>
|
|
|
123
|
+ <if test="renewalRequirements != null">renewal_requirements = #{renewalRequirements},</if>
|
|
|
124
|
+ <if test="storageLocationCode != null and storageLocationCode != ''">storage_location_code = #{storageLocationCode},</if>
|
|
|
125
|
+ <if test="certificateScanPath != null">certificate_scan_path = #{certificateScanPath},</if>
|
|
|
126
|
+ <if test="statusCode != null">status_code = #{statusCode},</if>
|
|
|
127
|
+ <if test="operatorId != null">operator_id = #{operatorId},</if>
|
|
|
128
|
+ <if test="operatorName != null">operator_name = #{operatorName},</if>
|
|
|
129
|
+ <if test="operatedAt != null">operated_at = #{operatedAt},</if>
|
|
|
130
|
+ <if test="createdAt != null">created_at = #{createdAt},</if>
|
|
|
131
|
+ <if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
|
|
132
|
+ </trim>
|
|
|
133
|
+ where id = #{id}
|
|
|
134
|
+ </update>
|
|
|
135
|
+
|
|
|
136
|
+ <delete id="deleteGasLicenseArchiveById" parameterType="Long">
|
|
|
137
|
+ delete from gas_license_archive where id = #{id}
|
|
|
138
|
+ </delete>
|
|
|
139
|
+
|
|
|
140
|
+ <delete id="deleteGasLicenseArchiveByIds" parameterType="String">
|
|
|
141
|
+ delete from gas_license_archive where id in
|
|
|
142
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
143
|
+ #{id}
|
|
|
144
|
+ </foreach>
|
|
|
145
|
+ </delete>
|
|
|
146
|
+</mapper>
|