<?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.MajorEquipmentMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.MajorEquipment" >
|
<!-- -->
|
<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="serial_number" property="serialNumber" jdbcType="BIGINT" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="VARCHAR" />
|
<result column="volume" property="volume" jdbcType="VARCHAR" />
|
<result column="user_id" property="userId" jdbcType="BIGINT" />
|
<result column="user_name" property="userName" jdbcType="VARCHAR" />
|
<result column="area_id" property="areaId" jdbcType="BIGINT" />
|
<result column="area_name" property="areaName" jdbcType="VARCHAR" />
|
|
</resultMap>
|
<select id="selectPages" resultMap="BaseResultMap">
|
SELECT
|
a.*,
|
b.realname user_name,
|
c.
|
VALUE
|
AS area_name
|
FROM
|
major_equipment AS a
|
LEFT JOIN USER AS b ON a.user_id = b.id
|
AND b.isdel = 0
|
LEFT JOIN dictionaryitem AS c ON a.area_id = c.id
|
AND c.STATUS = 1
|
WHERE
|
a.valid_flag = 1
|
<if test="params.name != null and params.name != ''">
|
and a.name like concat("%",#{params.name},"%")
|
</if>
|
<if test="params.status != null">
|
and a.status = #{params.status}
|
</if>
|
<if test="params.areaId != null">
|
and a.area_id = #{params.areaId}
|
</if>
|
order by a.create_time desc
|
</select>
|
|
|
<select id="getMajorEquipment" resultMap="BaseResultMap">
|
select id , name , serial_number
|
from major_equipment
|
where valid_flag = 1 and status=0
|
</select>
|
|
<select id="getBySerialNumber" resultMap="BaseResultMap">
|
select id , name , serial_number
|
from major_equipment
|
where valid_flag = 1 and serial_number= #{serialNumber}
|
<if test="id != null">
|
and id != #{id}
|
</if>
|
</select>
|
|
</mapper>
|