<?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.EquipmentInfoMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.EquipmentInfo" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="number" property="number" jdbcType="VARCHAR" />
|
<result column="isphoto" property="isphoto" jdbcType="TINYINT" />
|
<result column="photoname" property="photoname" jdbcType="VARCHAR" />
|
<result column="photoaddress" property="photoaddress" jdbcType="VARCHAR" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="updateby" property="updateby" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, name, number, isphoto, photoname, photoaddress, updatetime, updateby
|
</sql>
|
<select id="selectDataGrid" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
select *
|
from equipment
|
<where>
|
1=1
|
<if test="condition.name != null and condition.name != ''">
|
and name like concat('%',#{condition.name},'%')
|
</if>
|
<if test="condition.number != null and condition.number != ''">
|
and number like concat('%',#{condition.number},'%')
|
</if>
|
</where>
|
</select>
|
<select id="selectExistByNumber" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
select *
|
from equipment
|
where number = #{number}
|
<if test="id !=null">
|
and id != #{id}
|
</if>
|
</select>
|
<select id="selectByNumber" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
select *
|
from equipment
|
where number = #{equipmentnumber}
|
</select>
|
<select id="selectByTask" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
SELECT
|
equipment.*
|
FROM
|
taskequipmentbind
|
LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber
|
WHERE equipment.isphoto = 1
|
and equipment.photoname != ''
|
and equipment.photoaddress !=''
|
</select>
|
<select id="selectByTaskAndWorker" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
select
|
equipment.*
|
FROM
|
taskequipmentbind
|
LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber
|
<where>
|
taskequipmentbind.updateby = #{worker}
|
and taskequipmentbind.taskcode = #{code}
|
</where>
|
</select>
|
<select id="selectUsingByTask" resultType="com.gk.hotwork.Domain.EquipmentInfo">
|
SELECT
|
equipment.*
|
FROM
|
taskequipmentbind
|
LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber
|
<where>
|
taskequipmentbind.taskcode = #{code}
|
</where>
|
</select>
|
</mapper>
|