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
| <?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.gkhy.exam.system.mapper.InternalAuditCheckCatalogueMapper">
|
| <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
| INSERT INTO internal_audit_check_catalogue (
| check_id,
| catalogue_Id,
| point_key
| ) VALUES
| <foreach collection="catalogues" item="item" separator=",">
| (
| #{item.checkId},
| #{item.catalogueId},
| #{item.pointKey}
| )
| </foreach>
| </insert>
| <insert id="saveBatch">
| INSERT INTO internal_audit_check_catalogue (
| check_id,
| catalogue_Id,
| point_key,
| find
| ) VALUES
| <foreach collection="list" item="item" separator=",">
| (
| #{item.checkId},
| #{item.catalogueId},
| #{item.pointKey},
| #{item.find}
| )
| </foreach>
| </insert>
| <update id="updatebyCheckId">
| update internal_audit_check_catalogue set del_flag =1 where check_id = #{id}
| </update>
| <update id="updateCheckCatalogues">
| <foreach collection="list" item="item" separator=";">
| UPDATE internal_audit_check_catalogue
| <set>
| <if test="item.pointKey != null">`point_key` = #{item.pointKey},</if>
| <if test="item.find != null">`find` = #{item.find},</if>
| <if test="item.result != null">`result` = #{item.result},</if>
| </set>
| WHERE `id` = #{item.id}
| </foreach>
| </update>
|
| <select id="selectByCheckIds" resultType="com.gkhy.exam.system.domain.InternalAuditCheckCatalogue">
| SELECT
| iacc.`id`,
| iacc.`check_id`,
| iacc.`catalogue_id`,
| iacc.`point_key`,
| iacc.`find`,
| iacc.`result`,
| c.`clause_num` as number,
| c.`name` as mess,
| iacc.`del_flag`
| FROM
| `internal_audit_check_catalogue` iacc
| LEFT JOIN sys_clause_management c ON iacc.catalogue_id = c.id
| WHERE iacc.check_id IN
| <foreach collection="checkIds" item="id" open="(" separator="," close=")">
| #{id}
| </foreach>
| AND iacc.del_flag = 0
| ORDER BY
| CAST( SUBSTRING_INDEX( number, '.', 1 ) AS UNSIGNED ) ASC,
| CAST( IFNULL( SUBSTRING_INDEX( SUBSTRING_INDEX( number, '.', 2 ), '.', - 1 ), 0 ) AS UNSIGNED ) ASC,
| CAST( IFNULL( SUBSTRING_INDEX( SUBSTRING_INDEX( number, '.', 3 ), '.', - 1 ), 0 ) AS UNSIGNED ) ASC;
| </select>
| </mapper>
|
|