拆表及行业,技能添加 by kevin.cui

This commit is contained in:
Kevin Cui 2020-12-25 14:46:28 +08:00
parent 513bf28f67
commit f0c861c796
3 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package com.mindskip.xzs.domain;
import java.io.Serializable;
/**
* t_industry
* @author
*/
public class Industry implements Serializable {
private Integer id;
private String name;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,29 @@
package com.mindskip.xzs.repository;
import com.mindskip.xzs.domain.Industry;
import com.mindskip.xzs.domain.Subject;
import com.mindskip.xzs.viewmodel.admin.industry.IndustryEditRequestVM;
import com.mindskip.xzs.viewmodel.admin.industry.IndustryPageRequestVM;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface IndustryMapper extends BaseMapper<Industry> {
int deleteByPrimaryKey(Integer id);
int insert(Industry record);
int insertSelective(Industry record);
Industry selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Industry record);
int updateByPrimaryKey(Industry record);
List<Industry> page(IndustryPageRequestVM requestVM);
List<Industry> allIndustry();
}

View File

@ -0,0 +1,69 @@
<?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.mindskip.xzs.repository.IndustryMapper">
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Industry">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<sql id="Base_Column_List">
id, `name`
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_industry
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_industry
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mindskip.xzs.domain.Industry" useGeneratedKeys="true">
insert into t_industry (`name`)
values (#{name,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mindskip.xzs.domain.Industry" useGeneratedKeys="true">
insert into t_industry
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Industry">
update t_industry
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Industry">
update t_industry
set `name` = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.industry.IndustryEditRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_industry
<where>
<if test="id != null ">
and id= #{id}
</if>
</where>
</select>
<select id="allIndustry" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_industry
</select>
</mapper>