<?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.by4cloud.platformx.device.mapper.DeviceStocktakingPlanMapper">
|
|
<resultMap id="deviceStocktakingPlanMap" type="com.by4cloud.platformx.device.entity.DeviceStocktakingPlan">
|
<id property="id" column="id"/>
|
<result property="compId" column="comp_id"/>
|
<result property="endDate" column="end_date"/>
|
<result property="planName" column="plan_name"/>
|
<result property="planStatus" column="plan_status"/>
|
<result property="startDate" column="start_date"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="delFlag" column="del_flag"/>
|
</resultMap>
|
<select id="selectVoById" resultType="com.by4cloud.platformx.device.entity.vo.DeviceStocktakingPlanVo">
|
|
select
|
dsp.id,
|
dsp.plan_name,
|
dsp.start_date,
|
dsp.end_date,
|
dsp.plan_status,
|
(
|
select
|
GROUP_CONCAT(name)
|
from
|
platformxx_boot.sys_user su
|
where
|
exists (
|
select
|
*
|
from
|
device_stocktaking_plan_user dspu
|
where
|
dspu.stocktaking_user_id = su.user_id
|
and dspu.plan_id = dsp.id)) users,
|
(
|
select
|
GROUP_CONCAT(name)
|
from
|
device_class dc
|
where
|
exists (
|
select
|
*
|
from
|
device_stocktaking_plan_scope dsps
|
where
|
dsps.class_id = dc.id
|
and dsps.plan_id = dsp.id)) scopes
|
from
|
device_stocktaking_plan dsp
|
where
|
dsp.id = #{id}
|
</select>
|
</mapper>
|