linzhijie
2021-03-11 93af1c6ffb9ae0e894689ad3a37b548e57d54cff
src/main/java/com/ots/project/exam/service/impl/EntDemographyParamServiceImpl.java
@@ -1,4 +1,5 @@
package com.ots.project.exam.service.impl;
import com.ots.common.utils.DateUtils;
import com.ots.common.utils.StringUtils;
import com.ots.common.utils.text.Convert;
@@ -8,36 +9,70 @@
import com.ots.project.system.user.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 人口学变量定义Service业务层处理
 *
 * @author ots
 * @date 2019-12-11
 */
@Service
public class EntDemographyParamServiceImpl implements IEntDemographyParamService {
    @Autowired
    private EntDemographyParamMapper entDemographyParamMapper;
    @Autowired
    private UserMapper userMapper;
    /**
     * 查询人口学变量定义
     *
     * @param paramId 人口学变量定义ID
     * @return 人口学变量定义
     */
    @Override
    public EntDemographyParam selectEntDemographyParamById(Long paramId) {
        return entDemographyParamMapper.selectEntDemographyParamById(paramId);
    }
    /**
     * 查询人口学变量定义列表
     *
     * @param entDemographyParam 人口学变量定义
     * @return 人口学变量定义
     */
    @Override
    public List<EntDemographyParam> selectEntDemographyParamList(EntDemographyParam entDemographyParam) {
        return entDemographyParamMapper.selectEntDemographyParamList(entDemographyParam);
    }
    @Override
    public List<EntDemographyParam> selectEntDemographyParamListByParamIn(String paramIds) {
        return entDemographyParamMapper.selectEntDemographyParamListByParamIn(Convert.toStrArray(paramIds));
    }
    /**
     * 新增人口学变量定义
     *
     * @param entDemographyParam 人口学变量定义
     * @return 结果
     */
    @Override
    public int insertEntDemographyParam(EntDemographyParam entDemographyParam) {
        entDemographyParam.setCreateTime(DateUtils.getNowDate());
        return entDemographyParamMapper.insertEntDemographyParam(entDemographyParam);
    }
    /**
     * 修改人口学变量定义
     *
     * @param entDemographyParam 人口学变量定义
     * @return 结果
     */
    @Override
    public int updateEntDemographyParam(EntDemographyParam entDemographyParam) {
        if (StringUtils.isEmpty(entDemographyParam.getIsRequired())) {
@@ -46,12 +81,24 @@
        entDemographyParam.setUpdateTime(DateUtils.getNowDate());
        return entDemographyParamMapper.updateEntDemographyParam(entDemographyParam);
    }
    /**
     * 删除人口学变量定义对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEntDemographyParamByIds(String ids) {
        return entDemographyParamMapper.deleteEntDemographyParamByIds(Convert.toStrArray(ids));
    }
    /**
     * 删除人口学变量定义信息
     *
     * @param paramId 人口学变量定义ID
     * @return 结果
     */
    public int deleteEntDemographyParamById(Long paramId) {
        return entDemographyParamMapper.deleteEntDemographyParamById(paramId);
    }