|
@@ -183,10 +183,17 @@
|
|
|
AND dtrA.rel_code = #{param.relCode}
|
|
|
</if>
|
|
|
) AS dtr ON (dtr.obj_to = dto.id OR dtr.obj_from = dto.id)
|
|
|
+ <include refid="commonQueryObjectListByParamDtObjectWhereCondition">
|
|
|
+ <property name="param" value="#{param}"/>
|
|
|
+ </include>
|
|
|
+
|
|
|
+
|
|
|
+ </sql>
|
|
|
+ <sql id="commonQueryObjectListByParamDtObjectWhereCondition">
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="null!=param.projectId and param.projectId.length>0">
|
|
|
- AND dto.obj_from = #{param.projectId}
|
|
|
+ AND dto.project_id = #{param.projectId}
|
|
|
</if>
|
|
|
<if test="null!=param.objType and param.objType.length>0">
|
|
|
AND dto.obj_type = #{param.objType}
|
|
@@ -195,7 +202,16 @@
|
|
|
AND dto.local_name LIKE CONCAT('%',#{param.keyword},'%')
|
|
|
</if>
|
|
|
AND dto.valid = TRUE
|
|
|
-
|
|
|
+ </sql>
|
|
|
+ <sql id="commonQueryObjectListByParamSuffix">
|
|
|
+ GROUP BY
|
|
|
+ dto.id
|
|
|
+ <include refid="pageSet">
|
|
|
+ <property name="param" value="#{param}"/>
|
|
|
+ </include>
|
|
|
+ ;
|
|
|
+ SELECT
|
|
|
+ FOUND_ROWS( ) AS totalCount;
|
|
|
</sql>
|
|
|
|
|
|
|
|
@@ -235,14 +251,9 @@
|
|
|
<if test="null!=param.roomFuncType and param.roomFuncType.length>0">
|
|
|
AND JSON_UNQUOTE(JSON_EXTRACT(dto.infos, '$.roomFuncType'))=#{param.roomFuncType}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- dto.id
|
|
|
- <include refid="pageSet">
|
|
|
+ <include refid="commonQueryObjectListByParamSuffix">
|
|
|
<property name="param" value="#{param}"/>
|
|
|
</include>
|
|
|
- ;
|
|
|
- SELECT
|
|
|
- FOUND_ROWS( ) AS totalCount;
|
|
|
</select>
|
|
|
<select id="queryObjectListBySpaceIdAndClassCode" resultMap="BaseResultMap,count">
|
|
|
<include refid="commonQueryObjectListByParam">
|
|
@@ -251,17 +262,25 @@
|
|
|
<if test="null!=param.classCode and param.classCode.length>0">
|
|
|
AND dto.class_code=#{param.classCode}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- dto.id
|
|
|
- <include refid="pageSet">
|
|
|
+ <include refid="commonQueryObjectListByParamSuffix">
|
|
|
+ <property name="param" value="#{param}"/>
|
|
|
+ </include>
|
|
|
+ </select>
|
|
|
+ <select id="queryEquipListByClassCode" resultMap="BaseResultMap,count">
|
|
|
+ SELECT DISTINCT SQL_CALC_FOUND_ROWS
|
|
|
+ dto.*
|
|
|
+ FROM
|
|
|
+ dt_object AS dto
|
|
|
+ <include refid="commonQueryObjectListByParamDtObjectWhereCondition">
|
|
|
+ <property name="param" value="#{param}"/>
|
|
|
+ </include>
|
|
|
+ <if test="null!=param.classCode and param.classCode.length>0">
|
|
|
+ AND dto.class_code LIKE CONCAT(#{param.classCode},'%')
|
|
|
+ </if>
|
|
|
+ <include refid="commonQueryObjectListByParamSuffix">
|
|
|
<property name="param" value="#{param}"/>
|
|
|
</include>
|
|
|
- ;
|
|
|
- SELECT
|
|
|
- FOUND_ROWS( ) AS totalCount;
|
|
|
</select>
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
</mapper>
|