yangys
2024-10-10 c34415c583b097c5ad3a19684557d97402d2f230
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?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.qianwen.mdc.mapper.DncProcessingMapper">
  <resultMap id="BaseResultMap" type="com.qianwen.mdc.domain.DncProcessing">
   
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="machine_id" jdbcType="INTEGER" property="machineId" />
    <result column="file_name" jdbcType="VARCHAR" property="fileName" />
    <result column="prog_name" jdbcType="VARCHAR" property="progName" />
    <result column="component" jdbcType="VARCHAR" property="component" />
    <result column="process" jdbcType="VARCHAR" property="process" />
    <result column="version" jdbcType="VARCHAR" property="version" />
    <result column="time" jdbcType="TIMESTAMP" property="time" />
  </resultMap>
 
  <select id="getComponentList" resultType="String">
    select distinct component from dnc_processing
  </select>
 
  <select id="getProcessList" resultType="String">
    select distinct process from dnc_processing
  </select>
 
  <select id="selectProgParseMachineList" resultType="Integer">
    select
      distinct machine_id machineId
    from dnc_processing
    <where>
      <if test="component != null and component != ''">
        and component = #{component}
      </if>
      <if test="process != null and process != ''">
        and process = #{process}
      </if>
      <if test="timeBegin != null and timeBegin != ''">
        and time &gt;= #{timeBegin}
      </if>
      <if test="timeEnd != null and timeEnd != ''">
        and time &lt;= #{timeEnd}
      </if>
    </where>
  </select>
 
  <select id="selectProgParseList" resultType="com.qianwen.mdc.domain.DncProcessing">
    select * from dnc_processing
    <where>
      <if test="component != null and component != ''">
        and component = #{component}
      </if>
      <if test="process != null and process != ''">
        and process = #{process}
      </if>
      <if test="timeBegin != null and timeBegin != ''">
        and time &gt;= #{timeBegin}
      </if>
      <if test="timeEnd != null and timeEnd != ''">
        and time &lt;= #{timeEnd}
      </if>
      <if test="machineId != null and machineId != ''">
        and machine_id = #{machineId}
      </if>
    </where>
    order by machine_id asc, time asc
  </select>
  
  <!-- 工件 分页查询 -->
  <select id="queryPage" resultMap="BaseResultMap">
      SELECT 
      id,machine_id,file_name,prog_name,component,process,version,time 
      FROM dnc_processing 
      <where>
          <!-- 
           <if test="dto.sn != null and dto.sn != ''">
               <bind name="sn" value="'%' + dto.sn + '%'" />
           and sn like #{sn}
         </if>
          -->
         <if test="dto.component != null and dto.component != ''">
           and component=#{dto.component}
         </if>
         <if test="dto.process != null and dto.process != ''">
           and process=#{dto.process}
         </if>
      
         <if test="dto.timeBegin != null">
           and time&gt;=#{dto.timeBegin} 
         </if>
         <if test="dto.timeEnd != null">
           and time&lt;=#{dto.timeEnd} 
         </if>
      </where>
  </select>
</mapper>