2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
<?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.landtool.lanbase.modules.res.dao.ResStorageRelaTionMapper">
    <resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_Storage_Relation">
        <result column="RESOURCEID" property="resourceid" jdbcType="INTEGER" />
        <result column="FILENAME" property="filename" jdbcType="VARCHAR" />
        <result column="ISGENERATION" property="isgeneration" jdbcType="INTEGER" />
        <result column="ISSTORAGE" property="isstorage" jdbcType="INTEGER" />
    </resultMap>
    
    <select id="selectByResourceidAndFileName" resultMap="BaseResultMap">
        select * from RES_STORAGE_RELATION where RESOURCEID=#{resourceid} and FILENAME=#{filename}
    </select>
    
    <insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_Storage_Relation">
        insert into RES_STORAGE_RELATION
        <trim prefix="(" suffix=")" suffixOverrides=",">
          
          <if test="resourceid != null and resourceid!=''">
            RESOURCEID,
          </if>
          <if test="isstorage != null and isstorage!=''">
            ISSTORAGE,
          </if>
          <if test="isgeneration != null and isgeneration!=''">
            ISGENERATION,
          </if>
          <if test="filename != null and filename!=''">
            FILENAME,
          </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
          
          <if test="resourceid != null and resourceid!=''">
            #{resourceid,jdbcType=INTEGER},
          </if>
          <if test="isstorage != null and isstorage!=''">
            #{isstorage,jdbcType=INTEGER},
          </if>
          <if test="isgeneration != null and isgeneration!=''">
            #{isgeneration,jdbcType=INTEGER},
          </if>
          <if test="filename != null and filename!=''">
            #{filename,jdbcType=VARCHAR},
          </if>
        </trim>
    </insert>
    
    <update id="update" parameterType="com.landtool.lanbase.modules.res.entity.Res_Storage_Relation">
        UPDATE RES_STORAGE_RELATION
            <set>
              <if test="isgeneration != null and isgeneration!=''">
                   ISGENERATION = #{isgeneration,jdbcType=INTEGER},
              </if>
              <if test="isstorage != null and isstorage!=''">
                ISSTORAGE = #{isstorage,jdbcType=INTEGER},
              </if>
              <if test="filename != null and filename!=''">
                FILENAME = #{filename,jdbcType=VARCHAR},
              </if>
            </set>
        WHERE RESOURCEID = #{resourceid,jdbcType=INTEGER}
    </update>
 
</mapper>