You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-spms-java/src/main/resources/mybatis/mapper/dev/DeviceUpkeepMapper.xml

61 lines
3.0 KiB
XML

<?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.glxp.api.dao.dev.DeviceUpkeepMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceUpkeepEntity">
<id property="taskId" column="taskId" jdbcType="BIGINT"/>
<result property="planId" column="planId" jdbcType="BIGINT"/>
<result property="planName" column="planName" jdbcType="VARCHAR"/>
<result property="upkeepUserId" column="upkeepUserId" jdbcType="BIGINT"/>
<result property="upkeepUserName" column="upkeepUserName" jdbcType="VARCHAR"/>
<result property="upkeepUserPhone" column="upkeepUserPhone" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="sysFlag" column="sysFlag" jdbcType="BIT"/>
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
<result property="createUserId" column="createUserId" jdbcType="BIGINT"/>
<result property="createUserName" column="createUserName" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
taskId,planId,planName,
upkeepUserId,upkeepUserName,upkeepUserPhone,
name,remark,sysFlag,
createTime,createUserId,createUserName
</sql>
<select id="pageVo" resultType="com.glxp.api.vo.dev.DeviceUpkeepVo">
select c.*, d.name chargeDeptName
from device_upkeep c
left join auth_dept d on d.code = c.chargeDeptCode
<where>
<if test="taskId!=null">
and c.taskId = #{taskId}
</if>
<if test="chargeDeptCode!=null and chargeDeptCode!=''">
and c.chargeDeptCode = #{chargeDeptCode}
</if>
<if test="finishFlag!=null">
and c.finishFlag = #{finishFlag}
</if>
</where>
order by c.createTime desc
</select>
<select id="getVoById" resultType="com.glxp.api.vo.dev.DeviceUpkeepVo">
select u.*, d.name chargeDeptName
from device_upkeep u
left join auth_dept d on d.code = u.chargeDeptCode
where u.taskId = #{taskId}
</select>
<select id="pageListDetail" resultType="com.glxp.api.vo.dev.DeviceUpkeepDetailVo">
select dud.deviceCode deviceCode,dud.deptName deptName,dud.finishFlag finishFlag,dud.manufactory manufactory, itemCount,dud.exceptionCount exceptionCount,dud.finishCount finishCount,
createUserName,deviceCount
from device_upkeep_detail dud
left join device_upkeep du on dud.taskId = du.taskId
left join device_upkeep_detail_item dudi on dud.taskId = dudi.taskId
where dud.deviceCode = #{deviceCode}
</select>
</mapper>