<?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="cn.wise.sc.cement.business.mapper.PlanEquipmentMaintainMapper"> <sql id="where"> <where> <if test="params.status != null"> and t.status = #{params.status} </if> <if test="params.name != null and params.name != ''"> and t.name like concat('%', #{params.name}, '%') </if> </where> </sql> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo"> SELECT t.*, su.name as maintainerName FROM plan_equipment_maintain t left join sys_user su on su.id = t.maintainer_id <include refid="where"/> ORDER BY t.id DESC </select> <select id="exportList" resultType="java.util.HashMap"> SELECT (@i:=@i+1) as 序号, t.name as 产品名称, t.model as '规格/型号', t.code as 编号, t.maintain_date as 维护日期, t.maintain_content as 维护内容, su.name as 执行人, t.maintain_result as 完成情况 FROM plan_equipment_maintain t left join sys_user su on su.id = t.maintainer_id ,(select @i:=0)t <include refid="where"/> ORDER BY t.id DESC </select> <select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo"> SELECT t.*, su.name as maintainerName, su2.name as userName FROM plan_equipment_maintain t left join sys_user su on su.id = t.maintainer_id left join sys_user su2 on su2.id = t.user_id WHERE t.id = #{id} </select> <sql id="whereNew"> <where> <if test="params.name != null and params.name != ''"> and t.name like concat('%', #{params.name}, '%') </if> <if test="params.start !=null"> and t.create_time <![CDATA[>=]]> #{params.start} </if> <if test="params.end !=null"> and t.create_time <![CDATA[<=]]> #{params.end} </if> </where> </sql> <select id="exportWordList" resultType="cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo"> SELECT t.*, su.name as maintainerName FROM plan_equipment_maintain t left join sys_user su on su.id = t.maintainer_id <include refid="whereNew"/> ORDER BY t.id DESC </select> </mapper>