郑永安
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
70
71
72
73
74
75
76
<?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>