TpPEqpOperationSMapper.xml 3.39 KB
<?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.zteits.park.mapper.smapper.TpPEqpOperationSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPEqpOperation">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="eqp_no" jdbcType="VARCHAR" property="eqpNo" />
    <result column="eqp_name" jdbcType="VARCHAR" property="eqpName" />
    <result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="maintain_opt" jdbcType="VARCHAR" property="maintainOpt" />
    <result column="maintain_opt_phone" jdbcType="VARCHAR" property="maintainOptPhone" />
    <result column="maintain_state" jdbcType="INTEGER" property="maintainState" />
    <result column="factory_no" jdbcType="VARCHAR" property="factoryNo" />
    <result column="factory_name" jdbcType="VARCHAR" property="factoryName" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
  </resultMap>
  <sql id="Base_Column_List">
    id, eqp_no, eqp_name, eqp_type, pl_no, pl_name, maintain_opt, maintain_opt_phone, 
    maintain_state, factory_no, factory_name, remark, data_state, create_time, create_op, 
    modify_time, modify_op
  </sql>
  <!-- 分页查询设备维护信息 Paging query device, maintenance information  langlw 2017-9-12 -->
  <select id="queryEpqOperationForPage" parameterType="com.zteits.clouds.api.dto.park.param.QueryEpqOperationForPageRequest" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tp_p_eqp_operation
    where data_state=1
    <if test="plNos != null and plNos.size >0">
           and pl_no in
           <foreach collection="plNos" index="index" item="plNo" open="(" separator="," close=")">
           #{plNo}
           </foreach>
    </if>
    <if test="eqpTypes != null and eqpTypes.size >0">
           and eqp_type in
           <foreach collection="eqpTypes" index="index" item="eqpType" open="(" separator="," close=")">
           #{eqpType}
           </foreach>
    </if>
    <if test="maintainStates != null and maintainStates.size >0">
           and maintain_state in
           <foreach collection="maintainStates" index="index" item="maintainState" open="(" separator="," close=")">
           #{maintainState}
           </foreach>
    </if>
    <if test="eqpNo != null ">
           and eqp_no like '%${eqpNo}%'
    </if>
    
  </select>
  
  <!-- 逻辑删除设备维护信息 Logical delete device maintenance information langlw 2017-9-12 -->
  <update id="updateEqpOperationForDelete">
  	update tp_p_eqp_operation
  	set data_state=0
  	where 1=1
  	<if test="ids != null and ids.size >0">
           and id in
           <foreach collection="ids" index="index" item="id" open="(" separator="," close=")">
           #{id}
           </foreach>
    </if>
  </update>
  
  
    
  
  
  
  
  
</mapper>