Blame view

src/main/resources/mybatis/report/ExcelReportMapper.xml 3.59 KB
tangying authored
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
<?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.huaheng.pc.report.excelReport.mapper.ExcelReportMapper" >
    <insert id="insert" parameterType="com.huaheng.pc.report.excelReport.domain.Excelreport" keyProperty="id" useGeneratedKeys="true">
        insert into excelreport
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="name != null">
                name,
            </if>
            <if test="warehouseId != null">
                warehouseId,
            </if>
            <if test="warehouseCode != null">
                warehouseCode,
            </if>
            <if test="sql != null">
                `sql`,
            </if>
            <if test="remark != null">
                remark,
            </if>
            <if test="created != null">
                created,
            </if>
            <if test="createdBy != null">
                createdBy,
            </if>
        </trim>
        <trim prefix=" values (" suffix=")" suffixOverrides=",">
            <if test="name != null">
                #{name, jdbcType=VARCHAR},
            </if>
            <if test="warehouseId != null">
                #{warehouseId, jdbcType=INTEGER},
            </if>
            <if test="warehouseCode != null">
                #{warehouseCode, jdbcType=VARCHAR},
            </if>
            <if test="sql != null">
                #{sql, jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
                #{remark, jdbcType=VARCHAR},
            </if>
            <if test="created != null">
                #{created, jdbcType=TIMESTAMP},
            </if>
            <if test="createdBy != null">
                #{createdBy, jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>

    <update id="updateByModel">
        UPDATE excelreport
        <set>
            <if test="name != null">
               name = #{name, jdbcType=VARCHAR},
            </if>
            <if test="warehouseId != null">
              warehouseId =  #{warehouseId, jdbcType=INTEGER},
            </if>
            <if test="warehouseCode != null">
              warehouseCode =  #{warehouseCode, jdbcType=VARCHAR},
            </if>
            <if test="sql != null">
              `sql` =  #{sql, jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
              remark =  #{remark, jdbcType=VARCHAR},
            </if>
            <if test="created != null">
              created =  #{created, jdbcType=TIMESTAMP},
            </if>
            <if test="createdBy != null">
              createdBy  = #{createdBy, jdbcType=VARCHAR},
            </if>
            <if test="lastUpdated != null">
              lastUpdated = #{lastUpdated, jdbcType=TIMESTAMP},
            </if>
            <if test="lastUpdatedBy != null">
              lastUpdatedBy = #{lastUpdatedBy, jdbcType=VARCHAR},
            </if>
        </set>
        WHERE id = #{id,jdbcType=INTEGER}
    </update>
    <delete id="delete">
        delete  FROM  excelreport where id = #{id}
    </delete>


    <select id="selectCommon"  parameterType="String" resultType="java.util.LinkedHashMap">
        ${value}
    </select>
    <select id="selectById" resultType="com.huaheng.pc.report.excelReport.domain.Excelreport">
        select * from excelreport where id = #{id}
    </select>
    <select id="selectAll" resultType="com.huaheng.pc.report.excelReport.domain.Excelreport">
        select  * from excelreport where warehouseId = #{warehouseId}
    </select>
</mapper>