This commit is contained in:
huangzj
2023-08-03 14:03:46 +08:00
parent ab360ed348
commit 448af492d6
29 changed files with 457 additions and 151 deletions

View File

@@ -1,8 +1,10 @@
package com.njcn.csdevice.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.po.CsLedger;
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -18,4 +20,5 @@ public interface CsLedgerMapper extends BaseMapper<CsLedger> {
List<CsLedgerVO> getAll();
List<CsLedger> queryLine(@Param("lineParamdto") LineParamDTO lineParamdto);
}

View File

@@ -2,7 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.csdevice.mapper.CsLedgerMapper">
<select id="getAll" resultType="CsLedgerVO">
<sql id="Base_Column_List">
id,
pid,
pids,
`name`,
`level`,
sort,
remark,
`state`,
create_by,
create_time,
update_by,
update_time
</sql>
<resultMap id="BaseResultMap" type="com.njcn.csdevice.pojo.po.CsLedger">
<result column="id" property="id"/>
<result column="pid" property="pid"/>
<result column="pids" property="pids"/>
<result column="name" property="name"/>
<result column="level" property="level"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="state" property="state"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="update_by" property="updateBy"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<select id="getAll" resultType="CsLedgerVO">
select
id,pid,name,level,sort
from
@@ -11,4 +39,19 @@
state = 1
</select>
<select id="queryLine" resultType="com.njcn.csdevice.pojo.po.CsLedger">
select id from cs_ledger a where a.`Level`='3' and a.state='1'
<if test="lineParamdto.engineerId!=null and lineParamdto.engineerId!=''">
and FIND_IN_SET(#{lineParamdto.engineerId}, a.pids )
</if>
<if test="lineParamdto.projectId!=null and lineParamdto.projectId!=''">
and FIND_IN_SET(#{lineParamdto.projectId}, a.pids )
</if>
<if test="lineParamdto.devId!=null and lineParamdto.devId!=''">
and FIND_IN_SET(#{lineParamdto.devId}, a.pids )
</if>
</select>
</mapper>