Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
ac9e66d055
|
|
@ -39,7 +39,7 @@ public class MaterialController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(TbPromotionMaterial tbPromotionMaterial) {
|
||||
try {
|
||||
// startPage();
|
||||
startPage();
|
||||
List<TbPromotionMaterial> list = service.selectTbPromotionMaterialList(tbPromotionMaterial);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,19 @@ public class SysDept extends BaseEntity
|
|||
|
||||
/** 父部门名称 */
|
||||
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>();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,28 +20,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="userCount" column="userCount" />
|
||||
</resultMap>
|
||||
|
||||
<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
|
||||
from sys_dept d
|
||||
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
|
||||
LEFT JOIN sys_user u ON u.dept_id = d.dept_id AND u.del_flag = '0'
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
AND d.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
AND d.parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
AND d.dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
AND d.status = #{status}
|
||||
</if>
|
||||
GROUP BY
|
||||
d.dept_id
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
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">
|
||||
<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>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
|
|
|
|||
Loading…
Reference in New Issue