企业招聘平台-02-行业信息管理功能的开发

创建行业信息表

CREATE TABLE `industry` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '行业名称',
  `content` text COLLATE utf8mb4_unicode_ci COMMENT '行业描述',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='行业信息表';

Entity

public class Industry {
   
   
    private Integer id;
    private String name;
    private String content;

}

Mapper

public interface IndustryMapper {
   
   

    int insert(Industry industry);

    void updateById(Industry industry);

    void deleteById(Integer id);

    @Select("select * from `industry` where id = #{id}")
    Industry selectById(Integer id);

    List<Industry> selectAll(Industry industry);

}
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.mapper.IndustryMapper">

    <select id="selectAll" resultType="com.example.entity.Industry">
        select * from `industry`
        <where>
            <if test="name != null"> and title like concat('%', #{
   
   name}, '%')</if>
        </where>
    </select>

    <delete id="deleteById">
        delete from `industry`
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值