Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
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
104
105
106
107
108
109
110
111
<?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.firework.Mapper.EnterpriseStandardizationMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.EnterpriseStandardization" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="level" property="level" jdbcType="VARCHAR" />
    <result column="licensenumber" property="licensenumber" jdbcType="VARCHAR" />
    <result column="reviewunit" property="reviewunit" jdbcType="VARCHAR" />
    <result column="licensingunit" property="licensingunit" jdbcType="VARCHAR" />
    <result column="score" property="score" jdbcType="DECIMAL" />
    <result column="validstarttime" property="validstarttime" jdbcType="TIMESTAMP" />
    <result column="validendtime" property="validendtime" jdbcType="TIMESTAMP" />
    <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
    <result column="createby" property="createby" jdbcType="BIGINT" />
    <result column="createbyname" property="createbyname" jdbcType="VARCHAR" />
    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
    <result column="updateby" property="updateby" jdbcType="BIGINT" />
    <result column="updatebyname" property="updatebyname" jdbcType="VARCHAR" />
    <result column="enterpriseid" property="enterpriseid" jdbcType="BIGINT" />
    <result column="validflag" property="validflag" jdbcType="BIT" />
    <collection property="enterpriseResources"
                javaType="java.util.List"
                ofType="com.gk.firework.Domain.EnterpriseResource"
                column="{esid=id,tabletype=tabletype}"
                select="selectInner">
    </collection>
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, level, licensenumber, reviewunit, licensingunit, score, validstarttime, validendtime,
    createtime, createby, createbyname, updatetime, updateby, updatebyname, enterpriseid,
    validflag
  </sql>
    <select id="selectPages" resultMap="BaseResultMap">
        select es.*,
        #{params.tabletype} tabletype
        from enterprisestandardization es
        where es.validflag = 1
        and es.enterpriseid = #{params.id}
        order by es.createtime desc
    </select>
 
  <select id="selectInner" parameterType = "java.util.Map" resultType="com.gk.firework.Domain.EnterpriseResource">
      select  er.id id, er.url,er.filename,er.tabletype
      from enterpriseresource er
      where  er.validflag = 1
      and er.tabletype= #{tabletype}
      and belongid = #{esid}
    </select>
 
    <select id="selectStandardization"  resultMap="BaseResultMap">
        select es.*,
        #{tabletype} tabletype
        from enterprisestandardization es
        where es.validflag = 1
        and es.enterpriseid = #{id}
        order by es.createtime desc
    </select>
 
 
    <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.EnterpriseStandardization" >
    <!--          -->
    update enterprisestandardization
    <set >
      <if test="level != null" >
        level = #{level,jdbcType=VARCHAR},
      </if>
      <if test="licensenumber != null" >
        licensenumber = #{licensenumber,jdbcType=VARCHAR},
      </if>
      <if test="reviewunit != null" >
        reviewunit = #{reviewunit,jdbcType=VARCHAR},
      </if>
      <if test="licensingunit != null" >
        licensingunit = #{licensingunit,jdbcType=VARCHAR},
      </if>
      <if test="score != null" >
        score = #{score,jdbcType=INTEGER},
      </if>
      <if test="validstarttime != null" >
        validstarttime = #{validstarttime,jdbcType=TIMESTAMP},
      </if>
      <if test="validendtime != null" >
        validendtime = #{validendtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createtime != null" >
        createtime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createby != null" >
        createby = #{createby,jdbcType=BIGINT},
      </if>
      <if test="createbyname != null" >
        createbyname = #{createbyname,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null" >
        updatetime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateby != null" >
        updateby = #{updateby,jdbcType=BIGINT},
      </if>
      <if test="updatebyname != null" >
        updatebyname = #{updatebyname,jdbcType=VARCHAR},
      </if>
      <if test="validflag != null" >
        validflag = #{validflag,jdbcType=BIT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>