<?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 <= #{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>
|