郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
<?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.gk.hotwork.Mapper.AppFileInfoMapper" >
  <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.AppFileInfo" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="filetype" property="filetype" jdbcType="VARCHAR" />
    <result column="filename" property="filename" jdbcType="VARCHAR" />
    <result column="fileurl" property="fileurl" jdbcType="VARCHAR" />
    <result column="version" property="version" jdbcType="INTEGER" />
    <result column="remark" property="remark" jdbcType="VARCHAR" />
    <result column="created" property="created" jdbcType="TIMESTAMP" />
    <result column="updated" property="updated" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, filetype, filename, fileurl, version, remark, created, updated
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
    select
    <include refid="Base_Column_List" />
    from appfile
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.AppFileInfo">
    select
    <include refid="Base_Column_List" />
    from appfile
    <where>
      1=1
      <if test="condition.filetype != null and condition.filetype !=''">
        and filetype = #{filetype}
      </if>
    </where>
  </select>
  <select id="selectNew" resultType="com.gk.hotwork.Domain.AppFileInfo">
    select
    <include refid="Base_Column_List" />
    from appfile
    <where>
      1=1
      <if test="filetype != null and filetype !=''">
        and filetype = #{filetype}
      </if>
    </where>
    order by version desc
    limit 1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    delete from appfile
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.AppFileInfo" >
    <!--          -->
    update appfile
    <set >
      <if test="filetype != null" >
        filetype = #{filetype,jdbcType=VARCHAR},
      </if>
      <if test="filename != null" >
        filename = #{filename,jdbcType=VARCHAR},
      </if>
      <if test="fileurl != null" >
        fileurl = #{fileurl,jdbcType=VARCHAR},
      </if>
      <if test="version != null" >
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="remark != null" >
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="created != null" >
        created = #{created,jdbcType=TIMESTAMP},
      </if>
      <if test="updated != null" >
        updated = #{updated,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.AppFileInfo" >
    <!--          -->
    update appfile
    set filetype = #{filetype,jdbcType=VARCHAR},
      filename = #{filename,jdbcType=VARCHAR},
      fileurl = #{fileurl,jdbcType=VARCHAR},
      version = #{version,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      created = #{created,jdbcType=TIMESTAMP},
      updated = #{updated,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>