<?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.njcn.csdevice.mapper.CsEquipmentProcessPOMapper">
  <resultMap id="BaseResultMap" type="com.njcn.csdevice.pojo.po.CsEquipmentProcessPO">
    <!--@mbg.generated-->
    <!--@Table cs_equipment_process-->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="dev_id" jdbcType="VARCHAR" property="devId" />
    <result column="operator" jdbcType="VARCHAR" property="operator" />
    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="status" jdbcType="BIT" property="status" />
    <result column="process" jdbcType="INTEGER" property="process" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, dev_id, `operator`, start_time, end_time, `status`, `process`
  </sql>

  <select id="selectPages" resultType="com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO">
    select a.*,b.name devName from cs_equipment_process a left join cs_equipment_delivery b on a.dev_id =b.ndid
    where 1=1
    <if test="baseParam!=null and baseParam.searchValue  != null and baseParam.searchValue !=''">
      AND  b.name like concat(concat("%",#{baseParam.searchValue}),"%")
    </if>
    <if test="baseParam!=null and baseParam.searchEndTime  != null and baseParam.searchEndTime !=''">
      AND  DATE(a.start_time) &lt;= DATE(#{baseParam.searchEndTime})
    </if>
    <if test="baseParam!=null and baseParam.searchBeginTime != null and baseParam.searchBeginTime !=''">
      AND DATE(a.start_time) &gt;=  DATE(#{baseParam.searchBeginTime})
    </if>
    order by a.start_time desc
  </select>
</mapper>