“djh”
4 天以前 7acaebcb01438578ded72491f39105db893982ef
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
<?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.QualityTargetMapper">
 
    <insert id="insertQualityTargets">
        INSERT INTO `train_exam`.`quality_target` (
            `company_id`,`quality_id`,`message`,`num`,`method`,`calculate`,`data_source`,`depart_name`,
            `frequency`,`duty_name`,`remark`,`create_by`,`create_time`
        )
        VALUES
        <foreach collection="qualityTargets" separator="," item="item">
            (#{item.companyId},#{item.qualityId},#{item.message},#{item.num},#{item.method},#{item.calculate},
            #{item.dataSource},#{item.departName},#{item.frequency},#{item.dutyName},#{item.remark},
             #{item.createBy},#{item.createTime})
        </foreach>
    </insert>
 
    <update id="updateQualityTargetById">
        <foreach collection="qualityTargets" item="item" index="index" separator=";">
            UPDATE quality_target
            <set>
                <if test="item.companyId != null and item.companyId != ''" >
                    company_id = #{item.companyId},
                </if>
                <if test="item.qualityId != null and item.qualityId != ''" >
                    quality_id = #{item.qualityId},
                </if>
                <if test="item.message != null and item.message!=''" >
                    message = #{item.message},
                </if>
                <if test="item.num != null and item.num != ''" >
                    num = #{item.num},
                </if>
                <if test="item.method != null and item.method != ''" >
                    `method` = #{item.method},
                </if>
                <if test="item.calculate != null and item.calculate != ''" >
                    calculate = #{item.calculate},
                </if>
                <if test="item.dataSource != null and item.dataSource!=''" >
                    data_source = #{item.dataSource},
                </if>
                <if test="item.departName != null and item.departName != ''" >
                    depart_name = #{item.departName},
                </if>
                <if test="item.frequency != null and item.frequency != ''" >
                    frequency = #{item.frequency},
                </if>
                <if test="item.dutyName != null and item.dutyName != ''" >
                    duty_name = #{item.dutyName},
                </if>
                <if test="item.remark != null and item.remark != ''" >
                    remark = #{item.remark},
                </if>
                <if test="item.delFlag != null and item.delFlag != ''" >
                    del_flag = #{item.delFlag},
                </if>
                <if test="item.createBy != null" >
                    create_by = #{item.createBy},
                </if>
                <if test="item.createTime != null" >
                    create_time = #{item.createTime},
                </if>
                <if test="item.updateBy != null" >
                    update_by = #{item.updateBy},
                </if>
                <if test="item.updateTime != null" >
                    update_time = #{item.updateTime}
                </if>
            </set>
            where id = #{item.id}
        </foreach>
    </update>
 
    <update id="deleteByQualityIds">
        UPDATE quality_target set del_flag =2 where quality_id = #{qualityId}
    </update>
 
    <select id="selectByQualityId" resultType="com.gkhy.exam.system.domain.QualityTarget">
        select `id`,`company_id`,`quality_id`,`message`,`num`,`method`,`calculate`,`data_source`,`depart_name`,
               `frequency`,`duty_name`,`remark`,`del_flag`,`create_by`,`create_time`,`update_by`,`update_time`
        from quality_target
        where del_flag = 1
        <if test="qualityId!=null and qualityId!=''">
            and quality_id = #{qualityId}
        </if>
    </select>
</mapper>