Commit 1eabef89 authored by hongguangwu's avatar hongguangwu

MVP1.7.7-花名册

parent a77ea973
......@@ -42,8 +42,8 @@ public interface TCompleteMonitorSetBaseInfoMapper extends BaseMapper<TCompleteM
List<TCompleteMonitorSetBaseInfo> getBaseInfoByIds(@Param("ids") String ids);
// 获取类型需要完整的字段名
List<String> getIdByType(@Param("typeName") String typeName);
List<String> getIdByOne();
List<String> getBaseFieldByIdList(@Param("idList") List<String> idList);
String getIdByType(@Param("typeName") String typeName);
String getIdByOne();
List<String> getBaseFieldByIdArr(@Param("idArr") String[] idArr);
}
......@@ -58,18 +58,22 @@ public class TCompleteMonitorSetBaseInfoServiceImpl extends ServiceImpl<TComplet
**/
@Override
public List<String> getBaseFieldByTypeName(String typeName) {
List<String> idList = baseMapper.getIdByType(typeName);
String[] idArr = null;
String ids = baseMapper.getIdByType(typeName);
// 取默认配置
if (idList == null || idList.isEmpty() || "-1".equals(typeName)) {
idList = baseMapper.getIdByOne();
if (Common.isEmpty(ids) || "-1".equals(ids)) {
ids = baseMapper.getIdByOne();
}
if (idList == null || idList.isEmpty()) {
if (Common.isNotNull(ids)) {
idArr = ids.split(",");
}
if (idArr == null || idArr.length == 0) {
// -1表示不可以
List<String> stringList = new ArrayList<>();
stringList.add("-1");
return stringList;
}
return baseMapper.getBaseFieldByIdList(idList);
return baseMapper.getBaseFieldByIdArr(idArr);
}
}
......@@ -45,7 +45,7 @@
<!-- 获取属性字段 -->
<select id="getIdByType" resultType="java.lang.String">
select s.BASE_ID from t_complete_monitor_set s where s.CONTRACT_TYPE_NAME like concat('%', #{typeName},'%')
select s.BASE_ID from t_complete_monitor_set s where s.CONTRACT_TYPE_NAME like concat('%', #{typeName},'%') limit 1
</select>
<!-- 获取属性字段 -->
<select id="getIdByOne" resultType="java.lang.String">
......@@ -53,11 +53,11 @@
</select>
<!-- 获取属性字段 -->
<select id="getBaseFieldByIdList" resultType="java.lang.String">
<select id="getBaseFieldByIdArr" resultType="java.lang.String">
SELECT BASE_FIELD
FROM t_complete_monitor_set_base_info a
where a.id in
<foreach item="idStr" index="index" collection="idList" open="("
<foreach item="idStr" index="index" collection="idArr" open="("
separator="," close=")">
#{idStr}
</foreach>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment