<?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.SafetySelfInspectionMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetySelfInspection" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="valid_flag" property="validFlag" jdbcType="TINYINT" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
<result column="inspection_name" property="inspectionName" jdbcType="BIGINT" />
|
<result column="inspection_time" property="inspectionTime" jdbcType="BIGINT" />
|
<result column="inspector" property="inspector" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="VARCHAR" />
|
<result column="inspector_name" property="inspectorName" jdbcType="VARCHAR" />
|
|
</resultMap>
|
<select id="selectPages" resultMap="BaseResultMap">
|
select a.*,
|
b.realname inspector_name
|
from safety_self_inspection as a
|
left join user as b on a.inspector = b.id and b.isdel = 0
|
where a.valid_flag = 1
|
<if test="params.inspectionName != null and params.inspectionName != ''">
|
and a.inspection_name like concat("%",#{params.inspectionName},"%")
|
</if>
|
<if test="params.inspectorName != null and params.inspectorName != ''">
|
and b.realname like concat("%",#{params.inspectorName},"%")
|
</if>
|
<if test="params.inspectionStartTime != null and params.inspectionStartTime != ''" >
|
and a.inspection_time <![CDATA[ >= ]]> #{params.inspectionStartTime}
|
</if>
|
<if test="params.inspectionEndTime != null and params.inspectionEndTime != ''" >
|
and a.inspection_time <![CDATA[ <= ]]> #{params.inspectionEndTime}
|
</if>
|
order by a.create_time desc
|
</select>
|
|
</mapper>
|