Commit 0c8426df authored by 赵啸非's avatar 赵啸非

添加查询存在业务的部门

parent da359a72
...@@ -20,9 +20,12 @@ public interface DeptDao extends ICRUDDao<DeptEntity,Long>{ ...@@ -20,9 +20,12 @@ public interface DeptDao extends ICRUDDao<DeptEntity,Long>{
String GET_DEPT_LIST_BY_BUSINESS = "getDeptListByBusiness"; String GET_DEPT_LIST_BY_BUSINESS = "getDeptListByBusiness";
String GET_BUSINESS_BY_DEPT = "getBusinessByDept"; String GET_BUSINESS_BY_DEPT = "getBusinessByDept";
String GET_DEPTLIST_BY_EXISTBUSINESS = "getDeptListByExistBusiness";
List<DeptVo> getDeptListByBusiness(DeptQuery deptQuery); List<DeptVo> getDeptListByBusiness(DeptQuery deptQuery);
List<DeptVo> getBusinessByDept(DeptQuery deptQuery); List<DeptVo> getBusinessByDept(DeptQuery deptQuery);
List<DeptEntity> getDeptListByExistBusiness();
} }
...@@ -9,17 +9,21 @@ import com.mortals.xhx.module.matter.model.MatterEntity; ...@@ -9,17 +9,21 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.dept.dao.DeptDao; import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import java.util.Date; import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List; import java.util.List;
/** /**
* 部门DaoImpl DAO接口 * 部门DaoImpl DAO接口
* *
* @author zxfei * @author zxfei
* @date 2022-01-12 * @date 2022-01-12
*/ */
@Repository("deptDao") @Repository("deptDao")
public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements DeptDao { public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity, Long> implements DeptDao {
/** /**
* @param deptQuery * @param deptQuery
* @return * @return
...@@ -41,4 +45,12 @@ public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements ...@@ -41,4 +45,12 @@ public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements
List list = this.getSqlSession().selectList(this.getSqlId(GET_BUSINESS_BY_DEPT), paramDto); List list = this.getSqlSession().selectList(this.getSqlId(GET_BUSINESS_BY_DEPT), paramDto);
return list; return list;
} }
/**
* @return
*/
@Override
public List<DeptEntity> getDeptListByExistBusiness() {
return this.getSqlSession().selectList(this.getSqlId(GET_DEPTLIST_BY_EXISTBUSINESS));
}
} }
...@@ -49,6 +49,6 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> { ...@@ -49,6 +49,6 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> {
Rest<Map<String,List<DeptVo>>> getDeptListByBusiness(DeptQuery deptQuery, Context context); Rest<Map<String,List<DeptVo>>> getDeptListByBusiness(DeptQuery deptQuery, Context context);
List<DeptEntity> getDeptListByExistBusiness();
} }
\ No newline at end of file
...@@ -213,6 +213,14 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -213,6 +213,14 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
return Rest.ok(collect); return Rest.ok(collect);
} }
/**
* @return
*/
@Override
public List<DeptEntity> getDeptListByExistBusiness() {
return this.dao.getDeptListByExistBusiness();
}
/** /**
* @param entity * @param entity
......
...@@ -23,10 +23,7 @@ import com.mortals.xhx.module.site.service.SiteService; ...@@ -23,10 +23,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -145,6 +142,32 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic ...@@ -145,6 +142,32 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
} }
/**
* 根据部门查询业务
*/
@GetMapping(value = "getDeptListByExistBusiness")
@UnAuth
public String getDeptListByExistBusiness() {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据业务查询存在的部门列表" + this.getModuleDesc();
try {
List<DeptEntity> deptList = this.service.getDeptListByExistBusiness();
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA,deptList);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
/** /**
* 根据部门查询业务 * 根据部门查询业务
*/ */
......
...@@ -60,4 +60,18 @@ ...@@ -60,4 +60,18 @@
</select> </select>
<!-- 获取所有存在业务的部门列表 -->
<select id="getDeptListByExistBusiness" resultMap="DeptEntity-Map">
SELECT DISTINCT
<include refid="_columns"/>
FROM
mortals_sys_dept a,
mortals_sys_window t1,
mortals_sys_window_business t2
WHERE
a.id = t1.deptId
AND t1.id = t2.windowId;
</select>
</mapper> </mapper>
\ No newline at end of file
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