基于SpringBoot+Mybatis+Layui实现的简单就业管理系统

7 篇文章 0 订阅

基于SpringBoot+Mybatis+Layui实现的简单就业管理系统

系统分为管理员和会员角色,登录以后功能不同,实现了以下功能:

功能介绍

  1. 用户登录
  2. 就业信息管理:实现了就业信息的增删改查
  3. 就业统计:实现了对就业信息的统计,详情暂未实现
  4. 用户管理:实现了用户信息的维护

技术栈

SpringBoot+Maven+MyBatis+Layui

运行环境

jdk7/8+mysql5+IntelliJ IDEA+maven

项目结构

项目结构

效果演示

  由于篇幅有限,只贴出系统运行中部分功能的运行截图供大家参考。

1.登录
系统登录
2. 管理员首页
管理员首页
3. 就业信息添加
添加就业信息
4. 就业统计
就业统计
5. 用户管理
用户管理
6. 用户添加
添加用户
7. 会员界面
会员界面

示例代码

就业信息controller

@Controller
public class EmploymentInfoController {
    @Autowired
    EmploymentInfoService employmentInfoService;

    @RequestMapping({"/employment/index", "/employment/employmentinfo"})
    public String index(){
        return "system/employmentinfo/employmentinfo";
    }

    @ResponseBody
    @RequestMapping("/employment/getallinfo")
    public CommonResult<List<EmploymentInfo>> getAllInfo(EmploymentInfo employmentInfo, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
        List<EmploymentInfo> infoList = employmentInfoService.getAllEmploymentInfo(employmentInfo, pageNum, pageSize);
        CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);

        return rtInfoResult;
    }

    @ResponseBody
    @RequestMapping("/employment/getinfo")
    public CommonResult<List<EmploymentInfo>> getinfo(EmploymentInfo info, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
        List<EmploymentInfo> infoList = employmentInfoService.getEmploymentInfo(info, pageNum, pageSize);
        CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);

        return rtInfoResult;
    }

    @ResponseBody
    @RequestMapping("/employment/addinfo")
    public CommonResult<Integer> addInfo(EmploymentInfo info){
        info.setInformationId(UUID.randomUUID().toString());
        employmentInfoService.addEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/updateinfo")
    public CommonResult<Integer> updateInfo(EmploymentInfo info){
        employmentInfoService.updateEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employment/delinfo/{infoId}")
    public CommonResult<Integer> delInfo(@PathVariable("infoId") String infoId){
        employmentInfoService.deleteEmploymentInfo(infoId);
        return CommonResult.generateSuccessResult(1, 1);
    }
}

就业信息Service实现

@Service
@Service
public class EmploymentInfoServiceImpl implements EmploymentInfoService{
    @Autowired
    EmploymentInfoMapper employmentInfoMapper;

    @Override
    public List<EmploymentInfo> getAllEmploymentInfo(EmploymentInfo employmentInfo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return employmentInfoMapper.getAllEmploymentInfo(employmentInfo);
    }
    @Override
    public List<EmploymentInfo> getEmploymentInfo(EmploymentInfo employmentInfo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return employmentInfoMapper.getEmploymentInfo(employmentInfo);
    }
    @Override
    public List<Map<String, String>> getStudentCount(String fieldName, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return employmentInfoMapper.getStudentCount(fieldName);
    }
    @Override
    public void addEmploymentInfo(EmploymentInfo employmentInfo) {
        employmentInfoMapper.addEmploymentInfo(employmentInfo);
    }
    @Override
    public void updateEmploymentInfo(EmploymentInfo employmentInfo) {
        employmentInfoMapper.updateEmploymentInfo(employmentInfo);
    }
    @Override
    public void deleteEmploymentInfo(String infoId) {
        employmentInfoMapper.deleteEmploymentInfo(infoId);
    }
}

就业信息操作Mapper

<?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.code2life.employment.mapper.EmploymentInfoMapper">
   
    <select id="getEmploymentInfo" resultMap="employmentInfoResultMap">
        select information_id, company_name, company_address, employment_station, treatment, ability_requirement, student_name,
            student_major, student_gender, student_class, student_mobile, company_contact_name, company_contact_mobile, employment_time
        from employment_info order by employment_time
    </select>

    <select id="getAllEmploymentInfo" parameterType="com.code2life.employment.mapper.entity.EmploymentInfo" resultMap="employmentInfoResultMap">
        select information_id, company_name, company_address, employment_station, treatment, ability_requirement, student_name,
            student_major, student_class, student_gender, student_mobile, company_contact_name, company_contact_mobile, employment_time
        from employment_info
        where 1=1
        <if test="informationId != null and informationId != ''">
             and information_id = #{informationId}
        </if>
        <if test="studentMajor != null and studentMajor != ''">
            and student_major like '%${studentMajor}%'
        </if>
        <if test="studentClass != null and studentClass != ''">
            and student_class like '%${studentClass}%'
        </if>
        <if test="studentGender != null and studentGender != ''">
            and student_gender = #{studentGender}
        </if>
        <if test="companyName != null and companyName != ''">
            and company_name like '%${companyName}%'
        </if>
        <if test="employmentStation != null and employmentStation != ''">
            and employment_station like '%${employmentStation}%'
        </if>
        order by employment_time
    </select>

    <select id="getStudentCount" resultType="map">
        select count(information_id) studentCount, ${fieldName} from employment_info group by ${fieldName}
    </select>

    <insert id="addEmploymentInfo" parameterType="com.code2life.employment.mapper.entity.EmploymentInfo">
        insert into employment_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="informationId != null">
                 information_id,
            </if>
            <if test="studentMajor != null">
                 student_major,
            </if>
            <if test="studentClass != null">
                 student_class,
            </if>
            <if test="studentGender != null">
                 student_gender,
            </if>
            <if test="companyName != null">
                 company_name,
            </if>
            <if test="companyAddress != null">
                 company_address,
            </if>
            <if test="treatment != null">
                 treatment,
            </if>
            <if test="abilityRequirement != null">
                 ability_requirement,
            </if>
            <if test="studentMobile != null">
                 student_mobile,
            </if>
            <if test="employmentTime != null">
                 employment_time,
            </if>
            <if test="companyContactName != null">
                 company_contact_name,
            </if>
            <if test="companyContactMobile != null">
                 company_contact_mobile,
            </if>
            <if test="studentName != null">
                 student_name,
            </if>
            <if test="employmentStation != null">
                 employment_station,
            </if>
        </trim>
        <trim prefix="values(" suffix=")" suffixOverrides=",">
            <if test="informationId != null">
                #{informationId},
            </if>
            <if test="studentMajor != null">
                #{studentMajor},
            </if>
            <if test="studentClass != null">
                #{studentClass},
            </if>
            <if test="studentGender != null">
                #{studentGender},
            </if>
            <if test="companyName != null">
                #{companyName},
            </if>
            <if test="companyAddress != null">
                #{companyAddress},
            </if>
            <if test="treatment != null">
                #{treatment},
            </if>
            <if test="abilityRequirement != null">
                #{abilityRequirement},
            </if>
            <if test="studentMobile != null">
                #{studentMobile},
            </if>
            <if test="employmentTime != null">
                #{employmentTime},
            </if>
            <if test="companyContactName != null">
                #{companyContactName},
            </if>
            <if test="companyContactMobile != null">
                #{companyContactMobile},
            </if>
            <if test="studentName != null">
                #{studentName},
            </if>
            <if test="employmentStation != null">
                #{employmentStation},
            </if>
        </trim>
    </insert>

    <update id="updateEmploymentInfo" parameterType="com.code2life.employment.mapper.entity.EmploymentInfo">
        update employment_info
        <set>
            <if test="studentMajor != null">
                 student_major = #{studentMajor},
            </if>
            <if test="studentClass != null">
                 student_class = #{studentClass},
            </if>
            <if test="studentGender != null">
                 student_gender = #{studentGender},
            </if>
            <if test="companyName != null">
                 company_name = #{companyName},
            </if>
            <if test="companyAddress != null">
                 company_address = #{companyAddress},
            </if>
            <if test="treatment != null">
                 treatment = #{treatment},
            </if>
            <if test="abilityRequirement != null">
                 ability_requirement = #{abilityRequirement},
            </if>
            <if test="studentMobile != null">
                 student_mobile = #{studentMobile},
            </if>
            <if test="employmentTime != null">
                 employment_time = #{employmentTime},
            </if>
            <if test="companyContactName != null">
                 company_contact_name = #{companyContactName},
            </if>
            <if test="companyContactMobile != null">
                 company_contact_mobile = #{companyContactMobile},
            </if>
            <if test="studentName != null">
                 student_name = #{studentName},
            </if>
            <if test="employmentStation != null">
                 employment_station = #{employmentStation},
            </if>
        </set>
        where information_id = #{informationId}
    </update>

    <delete id="deleteEmploymentInfo">
        delete from employment_info where information_id = #{informationId}
    </delete>
</mapper>

最后

想进一步了解该系统或者获取完整源码,可扫码关注咨询。

扫码关注公众号

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值