Commit d09ce8f3 authored by 赵啸非's avatar 赵啸非

添加根据部门id 查询所属大厅

parent b6c8c210
......@@ -19,10 +19,13 @@ public interface WindowDao extends ICRUDDao<WindowEntity, Long> {
String SQLID_SUB_HALL_LIST = "getSubHallList";
String SQLID_SUB_HALL_COUNT = "getSubHallListCount";
String SQLID_GETHALLBYDEPT = "getHallByDept";
Result<WindowEntity> getSubHallList(WindowEntity windowQuery, PageInfo pageInfo);
Result<WindowEntity> getHallByDept(WindowEntity windowQuery);
}
......@@ -52,6 +52,19 @@ public class WindowDaoImpl extends BaseCRUDDaoMybatis<WindowEntity, Long> implem
return result;
}
/**
* @param windowQuery
* @return
*/
@Override
public Result<WindowEntity> getHallByDept(WindowEntity windowQuery) {
Result<WindowEntity> result = new Result();
ParamDto paramDto = this.getQueryParam(windowQuery);
List list = this.getSqlSession().selectList(this.getSqlId(SQLID_GETHALLBYDEPT), paramDto);
result.setList(list);
return result;
}
public int getSubHallListCount(ParamDto paramDto) {
return this.getSqlSession().selectOne(this.getSqlId(SQLID_SUB_HALL_COUNT), this.cpyQueryParamDto(paramDto));
}
......
......@@ -45,4 +45,7 @@ public interface WindowService extends ICRUDCacheService<WindowEntity, Long> {
Result<WindowEntity> findSubHallList(WindowEntity windowQuery, PageInfo pageInfo, Context context) throws AppException;
Result<WindowEntity> getHallByDept(WindowEntity windowQuery, Context context) throws AppException;
}
\ No newline at end of file
......@@ -152,6 +152,17 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
return this.getDao().getSubHallList(windowQuery, pageInfo);
}
/**
* @param windowQuery
* @param context
* @return
* @throws AppException
*/
@Override
public Result<WindowEntity> getHallByDept(WindowEntity windowQuery, Context context) throws AppException {
return this.getDao().getHallByDept(windowQuery);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
......
......@@ -112,4 +112,33 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
return ret;
}
@PostMapping(value = "getHallByDept")
@UnAuth
public Rest<Object> getHallByDept(@RequestBody WindowEntity query) {
Rest<Object> ret = new Rest<>();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
String busiDesc = "根据部门查询所属大厅!";
int code = VALUE_RESULT_SUCCESS;
try {
Result<WindowEntity> result = this.getService().getHallByDept(query, context);
model.put(KEY_RESULT_DATA, result.getList());
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
model.put(MESSAGE_INFO, busiDesc + "成功");
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】");
}
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get(MESSAGE_INFO) == null ? "" : model.remove(MESSAGE_INFO).toString());
return ret;
}
}
\ No newline at end of file
......@@ -32,4 +32,33 @@
</trim>
</select>
<!-- 根据部门id获取所属大厅 -->
<select id="getHallByDept" parameterType="paramDto" resultMap="WindowEntity-Map">
SELECT
deptId,deptName,hallId ,hallName
FROM
mortals_sys_window w,
mortals_sys_window_hall wh
<trim suffixOverrides="where" suffix="">
where w.id = wh.windowId
<trim prefixOverrides="and" prefix="">
<if test="condition.siteId!=null and condition.siteId!=''">
and a.siteId = #{condition.siteId}
</if>
<if test="condition.deptId!=null and condition.deptId!=''">
and a.deptId = #{condition.deptId}
</if>
<if test="condition.containsKey('deptIdList')">
deptId in
<foreach collection="condition.deptIdList" open="(" close=")" index="index"
item="item" separator=",">
#{item}
</foreach>
</if>
</trim>
</trim>
</select>
</mapper>
\ No newline at end of file
......@@ -163,4 +163,14 @@ Content-Type: application/x-www-form-urlencoded
businessid=125&matter=125&devicenum=C0-FB-F9-CD-3B-5D&peopleid=13
### 参数列表组合查询
POST {{baseUrl}}/param/list
Content-Type: application/json
{
"page":1,
"size": -1,
"firstOrganize": "Window",
"secondOrganize": "hongqi"
}
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