|
@@ -29,7 +29,7 @@
|
|
|
<select id="getSelectInfo" resultType="com.rongwei.bsentity.vo.KBDictDataVo">
|
|
|
<foreach collection="datas" separator="union all" item="data" >
|
|
|
<if test="data.enumType=='dict'">
|
|
|
- select name as label ,value as value,concat(#{data.tableName},"-;-",#{data.columnName}) as dictKey from sys_dict where DELETED='0' AND DICTTYPE=#{data.enumContent}
|
|
|
+ select name as label ,value as value,concat(#{data.tableName},"-;-",#{data.columnName}) as dictKey from sys_dict where DELETED='0' and PID != -1 AND DICTTYPE=#{data.enumContent}
|
|
|
</if>
|
|
|
<if test="data.enumType=='sql'">
|
|
|
select label,value,concat(#{data.tableName},"-;-",#{data.columnName}) as dictKey from (${data.enumContent}) a
|
|
@@ -76,7 +76,23 @@
|
|
|
'' AS systemName,
|
|
|
<foreach collection="searchVo.columnInfoList" item="columnInfo" separator=', "-@-",' open="CONCAT("
|
|
|
close=")">
|
|
|
- #{columnInfo.columnDesc},": ",ifnull(a.${columnInfo.columnName},"")
|
|
|
+ <choose>
|
|
|
+ <when test="columnInfo.dictData != null and columnInfo.dictData.size() > 0">
|
|
|
+ #{columnInfo.columnDesc},": ",
|
|
|
+ ifnull(
|
|
|
+ <foreach collection="columnInfo.dictData.keys" item="key">
|
|
|
+ REPLACE(
|
|
|
+ </foreach>
|
|
|
+ a.${columnInfo.columnName}
|
|
|
+ <foreach collection="columnInfo.dictData.entrySet()" index="key" item="val" separator=")" close=")" >
|
|
|
+ ,#{key},#{val}
|
|
|
+ </foreach>
|
|
|
+ ,"")
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ #{columnInfo.columnDesc},": ",ifnull(a.${columnInfo.columnName},"")
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</foreach>
|
|
|
as searchResult
|
|
|
from (${searchVo.tableSql}) a
|
|
@@ -85,24 +101,25 @@
|
|
|
AND
|
|
|
<foreach collection="searchVo.columnInfoList" item="columnInfo" separator=' or ' open="("
|
|
|
close=")">
|
|
|
- <bind name="pattern" value="'%' + columnInfo.searchValue + '%'"/>
|
|
|
<choose>
|
|
|
<when test="columnInfo.columnType=='DATETIME'">
|
|
|
- CAST(a.${columnInfo.columnName} AS CHAR) LIKE #{pattern}
|
|
|
+ CAST(a.${columnInfo.columnName} AS CHAR) LIKE "%"#{columnInfo.searchValue}"%"
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- a.${columnInfo.columnName} LIKE #{pattern}
|
|
|
+ a.${columnInfo.columnName} LIKE "%"#{columnInfo.searchValue}"%"
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</foreach>
|
|
|
- union all
|
|
|
- <include refid="kbSQL"></include>
|
|
|
+ <if test="systemId=='all'">
|
|
|
+ union all
|
|
|
+ <include refid="kbSQL"></include>
|
|
|
+ </if>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- )b where b.searchResult is not null order by b.createDate ${orderRules} limit #{pageNum},#{pageSize}
|
|
|
+ )b where b.searchResult is not null order by b.createDate ${orderRules} limit #{pageNum},#{pageSize}
|
|
|
</select>
|
|
|
<select id="getKbDataLength" resultType="java.lang.Integer">
|
|
|
select COUNT(*) from (
|
|
@@ -113,18 +130,7 @@
|
|
|
<otherwise>
|
|
|
<foreach collection="searchVos" item="searchVo" separator="union all">
|
|
|
select
|
|
|
- ID as dataId,
|
|
|
- #{searchVo.menuId} AS menuId,
|
|
|
- #{searchVo.menuName} AS menuName,
|
|
|
- #{searchVo.menuPid} AS systemId,
|
|
|
- #{searchVo.pagePartId} as pagePartId,
|
|
|
- a.CREATEDATE as createDate,
|
|
|
- '' AS systemName,
|
|
|
- <foreach collection="searchVo.columnInfoList" item="columnInfo" separator=', "-@-",' open="CONCAT("
|
|
|
- close=")">
|
|
|
- #{columnInfo.columnDesc},": ",ifnull(a.${columnInfo.columnName},"")
|
|
|
- </foreach>
|
|
|
- as searchResult
|
|
|
+ ID as dataId
|
|
|
from (${searchVo.tableSql}) a
|
|
|
<where>
|
|
|
AND DELETED ='0'
|
|
@@ -144,10 +150,12 @@
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</foreach>
|
|
|
- union all
|
|
|
- <include refid="kbSQL"></include>
|
|
|
+ <if test="systemId=='all'">
|
|
|
+ union all
|
|
|
+ <include refid="kbSQL"></include>
|
|
|
+ </if>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- )b where b.searchResult is not null
|
|
|
+ )b where b.dataId is not null
|
|
|
</select>
|
|
|
</mapper>
|