郑永安
2023-06-19 f65443d8abeaedc9d102324565e8368e7c9d90c8
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?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.AccessAssessApplyMapper" >
  <sql id="Base_Column_List" >
    <!--          -->
    id, type, code, status, requestor, submittime, approver, approvetime, approvenote,
    enterprisename, enterprisenumber, punishstatus, path1, path2, punishmentreason, punishmentmeasure,
    createtime, modifytime, lastrejecttime
  </sql>
 
  <select id="selectPages" resultType="com.gk.firework.Domain.AccessAssessApply">
    select *
    from assessapply
    where validflag = 1
    and type = #{params.type}
    <if test="params.requestorid != null and params.requestorid != ''">
      and requestorid = #{params.requestorid}
    </if>
    <if test="params.enterprisename != null and params.enterprisename != ''">
      and enterprisename like concat("%",#{params.enterprisename},"%")
    </if>
    <if test="params.status != null and params.status != ''">
      and status = #{params.status}
    </if>
    <if test="params.code != null and params.code != ''">
      and code like concat("%",#{params.code},"%")
    </if>
    order by createtime desc
  </select>
  <select id="selectAppealPages" resultType="com.gk.firework.Domain.Vo.AssessApplyAppealVo">
    select
    id,
    code,
    enterprisename,
    enterprisenumber,
    punishmentreason,
    punishmentmeasure,
    path1,
    path2,
    punishstatus,
    approvetime,
    approvenote,
    deadline,
    appealcontent,
    appealstatus,
    appealapprover,
    appealapprovetime,
    case when date_add(now(),interval 7 day) &gt;= deadline and appealstatus != #{params.passed} then 1 else 0 end iswarn,
    case when punishstatus = #{params.unpunish} and now() &lt; deadline and appealstatus = #{params.unappealed} then 1 else 0  end whetherCanAppeal
    from assessapply
    where validflag = 1
    and type = #{params.type}
    and status = #{params.status}
    <if test="params.enterprisenumber != null and params.enterprisenumber != ''">
      and enterprisenumber =  #{enterprisenumber}
    </if>
    <if test="params.appealstatus != null and params.appealstatus != ''">
      and appealstatus =  #{params.appealstatus}
    </if>
    <if test="params.enterprisename != null and params.enterprisename != ''">
      and enterprisename like concat("%",#{params.enterprisename},"%")
    </if>
    <if test="params.code != null and params.code != ''">
      and code like concat("%",#{params.code},"%")
    </if>
    order by whetherCanAppeal desc,deadline asc
  </select>
  <select id="selectAllOverTimeAccessAssessApply" resultType="com.gk.firework.Domain.AccessAssessApply">
    select *
    from assessapply
    where
    validflag = 1
    and deadline &lt;= now()
    and type = #{access}
    and appealstatus != #{passed}
    and punishstatus = #{unPunish}
 
  </select>
  <select id="selectAllPunishingAccessAssessApply" resultType="com.gk.firework.Domain.AccessAssessApply">
    select *
    from assessapply
    where
    validflag = 1
    and type = #{access}
    and punishstatus = #{punishing}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    delete from assessapply
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.AssessApply" >
    <!--          -->
    update assessapply
    <set >
      <if test="type != null" >
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="code != null" >
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="requestor != null" >
        requestor = #{requestor,jdbcType=VARCHAR},
      </if>
      <if test="submittime != null" >
        submittime = #{submittime,jdbcType=TIMESTAMP},
      </if>
      <if test="approver != null" >
        approver = #{approver,jdbcType=VARCHAR},
      </if>
      <if test="approvetime != null" >
        approvetime = #{approvetime,jdbcType=TIMESTAMP},
      </if>
      <if test="approvenote != null" >
        approvenote = #{approvenote,jdbcType=VARCHAR},
      </if>
      <if test="enterprisename != null" >
        enterprisename = #{enterprisename,jdbcType=VARCHAR},
      </if>
      <if test="enterprisenumber != null" >
        enterprisenumber = #{enterprisenumber,jdbcType=VARCHAR},
      </if>
      <if test="path1 != null" >
        path1 = #{path1,jdbcType=VARCHAR},
      </if>
      <if test="path2 != null" >
        path2 = #{path2,jdbcType=VARCHAR},
      </if>
      <if test="punishmentreason != null" >
        punishmentreason = #{punishmentreason,jdbcType=VARCHAR},
      </if>
      <if test="punishmentmeasure != null" >
        punishmentmeasure = #{punishmentmeasure,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        createtime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifytime != null" >
        modifytime = #{modifytime,jdbcType=TIMESTAMP},
      </if>
      <if test="lastrejecttime != null" >
        lastrejecttime = #{lastrejecttime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.AssessApply" >
    <!--          -->
    update assessapply
    set type = #{type,jdbcType=VARCHAR},
    code = #{code,jdbcType=VARCHAR},
    status = #{status,jdbcType=VARCHAR},
    requestor = #{requestor,jdbcType=VARCHAR},
    submittime = #{submittime,jdbcType=TIMESTAMP},
    approver = #{approver,jdbcType=VARCHAR},
    approvetime = #{approvetime,jdbcType=TIMESTAMP},
    approvenote = #{approvenote,jdbcType=VARCHAR},
    enterprisename = #{enterprisename,jdbcType=VARCHAR},
    enterprisenumber = #{enterprisenumber,jdbcType=VARCHAR},
    path1 = #{path1,jdbcType=VARCHAR},
    path2 = #{path2,jdbcType=VARCHAR},
    punishmentreason = #{punishmentreason,jdbcType=VARCHAR},
    punishmentmeasure = #{punishmentmeasure,jdbcType=VARCHAR},
    createtime = #{createtime,jdbcType=TIMESTAMP},
    modifytime = #{modifytime,jdbcType=TIMESTAMP},
    lastrejecttime = #{lastrejecttime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>