Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
ac9e66d055
|
|
@ -39,7 +39,7 @@ public class MaterialController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(TbPromotionMaterial tbPromotionMaterial) {
|
public TableDataInfo list(TbPromotionMaterial tbPromotionMaterial) {
|
||||||
try {
|
try {
|
||||||
// startPage();
|
startPage();
|
||||||
List<TbPromotionMaterial> list = service.selectTbPromotionMaterialList(tbPromotionMaterial);
|
List<TbPromotionMaterial> list = service.selectTbPromotionMaterialList(tbPromotionMaterial);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,18 @@ public class SysDept extends BaseEntity
|
||||||
|
|
||||||
/** 父部门名称 */
|
/** 父部门名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
/**
|
||||||
|
* 部署人员
|
||||||
|
*/
|
||||||
|
private String userCount;
|
||||||
|
|
||||||
|
public String getUserCount() {
|
||||||
|
return userCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserCount(String userCount) {
|
||||||
|
this.userCount = userCount;
|
||||||
|
}
|
||||||
|
|
||||||
/** 子部门 */
|
/** 子部门 */
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
|
|
|
||||||
|
|
@ -20,28 +20,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="userCount" column="userCount" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDeptVo">
|
<sql id="selectDeptVo">
|
||||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time ,COUNT(u.user_id) AS userCount
|
||||||
from sys_dept d
|
from sys_dept d
|
||||||
|
LEFT JOIN sys_user u ON u.dept_id = d.dept_id AND u.del_flag = '0'
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where d.del_flag = '0'
|
where d.del_flag = '0'
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND dept_id = #{deptId}
|
AND d.dept_id = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="parentId != null and parentId != 0">
|
<if test="parentId != null and parentId != 0">
|
||||||
AND parent_id = #{parentId}
|
AND d.parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptName != null and deptName != ''">
|
<if test="deptName != null and deptName != ''">
|
||||||
AND dept_name like concat('%', #{deptName}, '%')
|
AND d.dept_name like concat('%', #{deptName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND status = #{status}
|
AND d.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
d.dept_id
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
order by d.parent_id, d.order_num
|
order by d.parent_id, d.order_num
|
||||||
|
|
@ -84,7 +88,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
where d.dept_name=#{deptName} and d.parent_id = #{parentId} and d.del_flag = '0'
|
||||||
|
GROUP BY
|
||||||
|
d.dept_id
|
||||||
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertDept" parameterType="SysDept">
|
<insert id="insertDept" parameterType="SysDept">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue