郑永安
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
<?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.RiskSourceMapper" >
  <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskSource" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="name" property="name" jdbcType="VARCHAR"/>
    <result column="type" property="type" jdbcType="TINYINT"/>
    <result column="level" property="level" jdbcType="TINYINT"/>
    <result column="status" property="status" jdbcType="TINYINT"/>
    <result column="depId" property="dep_id" jdbcType="BIGINT"/>
    <result column="createUid" property="create_uid" jdbcType="BIGINT"/>
    <result column="editUid" property="edit_uid" jdbcType="BIGINT"/>
    <result column="createTime" property="create_time" jdbcType="TIMESTAMP"/>
    <result column="editTime" property="edit_time" jdbcType="TIMESTAMP"/>
    <result column="createUname" property="create_uname" jdbcType="VARCHAR"/>
    <result column="editUname" property="edit_uname" jdbcType="VARCHAR"/>
    <result column="depName" property="dep_name" jdbcType="VARCHAR"/>
    <result column="location" property="location" jdbcType="VARCHAR"/>
    <result column="accidentDesc" property="accident_desc" jdbcType="VARCHAR"/>
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id,name,type,level,status,dep_id,create_uid,edit_uid,create_time,edit_time,create_uname,edit_uname,dep_name,location,accident_desc
  </sql>
  <select id="findRiskSourceListByConditionsAndPage" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"/>
    from risk_source
    <where>
         status != 3
        <if test="parm.type != null">
          and type = #{parm.type}
        </if>
        <if test="parm.status != null">
          and status = #{parm.status}
        </if>
        <if test="parm.level != null">
          and level = #{parm.level}
        </if>
        <if test="parm.depId != null">
          and dep_id = #{parm.depId}
        </if>
        <if test="parm.startTime != null">
            and create_time >= #{parm.startTime}
        </if>
        <if test="parm.endTime != null">
            and create_time &lt;= #{parm.endTime}
        </if>
        <if test="parm.name != null and parm.name != ''">
            <bind name="namePat" value="'%' + parm.name + '%'"/>
            and name like #{namePat}
        </if>
        <if test="parm.depName != null and parm.depName != ''">
            <bind name="depnamePat" value="'%' + parm.depName + '%'"/>
            and dep_name like #{depnamePat}
        </if>
        <if test="parm.location != null and parm.location != ''">
            <bind name="locatPat" value="'%' + parm.location + '%'"/>
            and location like #{localPat}
        </if>
    </where>
  </select>
 
  <!--  List<RiskSource> getRiskSourceList();-->
    <select id="getRiskSourceList" resultMap="BaseResultMap">
        select * from risk_source where status = 1
    </select>
 
</mapper>