居民信息添加数据权限设置

main
hansha 2 years ago
parent 238da2c6e3
commit 180293558d

@ -71,6 +71,11 @@ public class SzxcJmInfoController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SzxcJmInfo szxcJmInfo) public AjaxResult add(@RequestBody SzxcJmInfo szxcJmInfo)
{ {
//根据前端传递过来的部门存储,如果没传则存储当前用户的部门
if(szxcJmInfo.getDeptId()==null){
szxcJmInfo.setDeptId(getDeptId());
}
szxcJmInfo.setUserId(getUserId());
return toAjax(szxcJmInfoService.insertSzxcJmInfo(szxcJmInfo)); return toAjax(szxcJmInfoService.insertSzxcJmInfo(szxcJmInfo));
} }

@ -1,61 +0,0 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmTag;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmTagService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param szxcJmTag
* @return
*/
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmTagByJmId(Long jmId);
}

@ -1,5 +1,6 @@
package com.ruoyi.szxc.service.impl; package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcJmInfo; import com.ruoyi.szxc.domain.SzxcJmInfo;
import com.ruoyi.szxc.mapper.SzxcJmInfoMapper; import com.ruoyi.szxc.mapper.SzxcJmInfoMapper;
@ -40,6 +41,7 @@ public class SzxcJmInfoServiceImpl implements ISzxcJmInfoService
* @return * @return
*/ */
@Override @Override
@DataScope(deptAlias = "j")
public List<SzxcJmInfo> selectSzxcJmInfoList(SzxcJmInfo szxcJmInfo) public List<SzxcJmInfo> selectSzxcJmInfoList(SzxcJmInfo szxcJmInfo)
{ {
return szxcJmInfoMapper.selectSzxcJmInfoList(szxcJmInfo); return szxcJmInfoMapper.selectSzxcJmInfoList(szxcJmInfo);

@ -1,93 +0,0 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcJmTagMapper;
import com.ruoyi.szxc.domain.SzxcJmTag;
import com.ruoyi.szxc.service.ISzxcJmTagService;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmTagServiceImpl implements ISzxcJmTagService
{
@Autowired
private SzxcJmTagMapper szxcJmTagMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.selectSzxcJmTagByJmId(jmId);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.selectSzxcJmTagList(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int insertSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.insertSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int updateSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.updateSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmTagByJmIds(Long[] jmIds)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmId(jmId);
}
}

@ -1,5 +1,6 @@
package com.ruoyi.szxc.service.impl; package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcPersonTag; import com.ruoyi.szxc.domain.SzxcPersonTag;
import com.ruoyi.szxc.mapper.SzxcPersonTagMapper; import com.ruoyi.szxc.mapper.SzxcPersonTagMapper;
@ -41,7 +42,7 @@ public class SzxcPersonTagServiceImpl implements ISzxcPersonTagService
*/ */
@Override @Override
// @DataScope(deptAlias = "d", userAlias= "d") // @DataScope(deptAlias = "d", userAlias= "d")
//@DataScope(deptAlias = "d") @DataScope(deptAlias = "d")
public List<SzxcPersonTag> selectSzxcPersonTagList(SzxcPersonTag szxcPersonTag) public List<SzxcPersonTag> selectSzxcPersonTagList(SzxcPersonTag szxcPersonTag)
{ {
return szxcPersonTagMapper.selectSzxcPersonTagList(szxcPersonTag); return szxcPersonTagMapper.selectSzxcPersonTagList(szxcPersonTag);

@ -44,9 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult"> <select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult">
<include refid="selectSzxcJmInfoVo"/> <include refid="selectSzxcJmInfoVo"/> j
<where> <where>
<if test="deptId != null "> and dept_id = #{deptId}</if> <!-- <if test="deptId != null "> and dept_id = #{deptId}</if>-->
<if test="deptId != null and deptId != 0">
AND (d.dept_id = #{deptId} OR d.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if> <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if> <if test="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if>
@ -73,6 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sameHeadIds != null and sameHeadIds != ''"> and same_head_ids = #{sameHeadIds}</if> <if test="sameHeadIds != null and sameHeadIds != ''"> and same_head_ids = #{sameHeadIds}</if>
<if test="off != null and off != ''"> and off = #{off}</if> <if test="off != null and off != ''"> and off = #{off}</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
<!-- 数据范围过滤 -->
<if test="params.dataScope != null and params.dataScope !=''">
${params.dataScope}
</if>
</where> </where>
</select> </select>

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcJmTagMapper">
<resultMap type="SzxcJmTag" id="SzxcJmTagResult">
<result property="jmId" column="jm_id" />
<result property="tagId" column="tag_id" />
</resultMap>
<sql id="selectSzxcJmTagVo">
select jm_id, tag_id from szxc_jm_tag
</sql>
<select id="selectSzxcJmTagList" parameterType="SzxcJmTag" resultMap="SzxcJmTagResult">
<include refid="selectSzxcJmTagVo"/>
<where>
</where>
</select>
<select id="selectSzxcJmTagByJmId" parameterType="Long" resultMap="SzxcJmTagResult">
<include refid="selectSzxcJmTagVo"/>
where jm_id = #{jmId}
</select>
<insert id="insertSzxcJmTag" parameterType="SzxcJmTag">
insert into szxc_jm_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="tagId != null">tag_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="tagId != null">#{tagId},</if>
</trim>
</insert>
<update id="updateSzxcJmTag" parameterType="SzxcJmTag">
update szxc_jm_tag
<trim prefix="SET" suffixOverrides=",">
<if test="tagId != null">tag_id = #{tagId},</if>
</trim>
where jm_id = #{jmId}
</update>
<delete id="deleteSzxcJmTagByJmId" parameterType="Long">
delete from szxc_jm_tag where jm_id = #{jmId}
</delete>
<delete id="deleteSzxcJmTagByJmIds" parameterType="String">
delete from szxc_jm_tag where jm_id in
<foreach item="jmId" collection="array" open="(" separator="," close=")">
#{jmId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save