Browse Source

fix: 演练管理添加数据权限

zhongwei
liwen 9 months ago
parent
commit
af94dfe8d7
  1. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  2. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  3. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -34,4 +35,11 @@ public interface RehearsalRecordMapper extends UserDataScopeBaseMapper<Rehearsal
*/ */
@UserDataAuth @UserDataAuth
IPage<RehearsalRecordlVO> getRehearsalRecordPage(IPage<RehearsalRecordlVO> page, Map<String, Object> param); IPage<RehearsalRecordlVO> getRehearsalRecordPage(IPage<RehearsalRecordlVO> page, Map<String, Object> param);
/**
* 查询当月演练记录
* @param month 当月
* @return 当月演练数据表
*/
List<RehearsalRecordEntity> selectRehearsalByMonth(String month);
} }

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml

@ -39,4 +39,16 @@
ORDER BY ORDER BY
t1.create_time DESC t1.create_time DESC
</select> </select>
<select id="selectRehearsalByMonth" resultType="com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity">
SELECT
*
FROM
hzims_rehearsal_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
create_time DESC
</select>
</mapper> </mapper>

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -23,7 +23,6 @@ import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -116,10 +115,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
* @return 当月演练数据表 * @return 当月演练数据表
*/ */
public List<RehearsalRecordEntity> getRehearsalByMonth(String month) { public List<RehearsalRecordEntity> getRehearsalByMonth(String month) {
QueryWrapper<RehearsalRecordEntity> queryWrapper = new QueryWrapper<>(); return baseMapper.selectRehearsalByMonth(month);
queryWrapper.lambda().like(RehearsalRecordEntity::getCreateTime, month)
.orderByDesc(RehearsalRecordEntity::getCode);
return this.list(queryWrapper);
} }
/** /**

Loading…
Cancel
Save