|
|
|
@ -2,12 +2,22 @@ package com.hai.dao; |
|
|
|
|
|
|
|
|
|
import com.hai.entity.CmsCategory; |
|
|
|
|
import com.hai.entity.CmsCategoryExample; |
|
|
|
|
import org.apache.ibatis.annotations.*; |
|
|
|
|
import java.util.List; |
|
|
|
|
import org.apache.ibatis.annotations.Delete; |
|
|
|
|
import org.apache.ibatis.annotations.DeleteProvider; |
|
|
|
|
import org.apache.ibatis.annotations.Insert; |
|
|
|
|
import org.apache.ibatis.annotations.InsertProvider; |
|
|
|
|
import org.apache.ibatis.annotations.Options; |
|
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
|
import org.apache.ibatis.annotations.Result; |
|
|
|
|
import org.apache.ibatis.annotations.Results; |
|
|
|
|
import org.apache.ibatis.annotations.Select; |
|
|
|
|
import org.apache.ibatis.annotations.SelectProvider; |
|
|
|
|
import org.apache.ibatis.annotations.Update; |
|
|
|
|
import org.apache.ibatis.annotations.UpdateProvider; |
|
|
|
|
import org.apache.ibatis.type.JdbcType; |
|
|
|
|
import org.springframework.stereotype.Repository; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* 代码由工具生成,请勿修改!!! |
|
|
|
@ -29,14 +39,16 @@ public interface CmsCategoryMapper extends CmsCategoryMapperExt { |
|
|
|
|
int deleteByPrimaryKey(Long id); |
|
|
|
|
|
|
|
|
|
@Insert({ |
|
|
|
|
"insert into cms_category (parent_id, `name`, ", |
|
|
|
|
"code, sort, cover_img, ", |
|
|
|
|
"`status`, remark, ", |
|
|
|
|
"ext_1, ext_2, ext_3)", |
|
|
|
|
"values (#{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ", |
|
|
|
|
"#{code,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{coverImg,jdbcType=VARCHAR}, ", |
|
|
|
|
"#{status,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, ", |
|
|
|
|
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
|
|
|
|
"insert into cms_category (`type`, parent_id, ", |
|
|
|
|
"`name`, code, sort, ", |
|
|
|
|
"cover_img, `status`, ", |
|
|
|
|
"remark, ext_1, ext_2, ", |
|
|
|
|
"ext_3)", |
|
|
|
|
"values (#{type,jdbcType=INTEGER}, #{parentId,jdbcType=BIGINT}, ", |
|
|
|
|
"#{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, ", |
|
|
|
|
"#{coverImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
|
|
|
|
"#{remark,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
|
|
|
|
"#{ext3,jdbcType=VARCHAR})" |
|
|
|
|
}) |
|
|
|
|
@Options(useGeneratedKeys=true,keyProperty="id") |
|
|
|
|
int insert(CmsCategory record); |
|
|
|
@ -48,6 +60,7 @@ public interface CmsCategoryMapper extends CmsCategoryMapperExt { |
|
|
|
|
@SelectProvider(type=CmsCategorySqlProvider.class, method="selectByExample") |
|
|
|
|
@Results({ |
|
|
|
|
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
|
|
|
|
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
|
|
|
|
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT), |
|
|
|
|
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
|
|
|
|
@Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), |
|
|
|
@ -63,13 +76,14 @@ public interface CmsCategoryMapper extends CmsCategoryMapperExt { |
|
|
|
|
|
|
|
|
|
@Select({ |
|
|
|
|
"select", |
|
|
|
|
"id, parent_id, `name`, code, sort, cover_img, `status`, remark, ext_1, ext_2, ", |
|
|
|
|
"ext_3", |
|
|
|
|
"id, `type`, parent_id, `name`, code, sort, cover_img, `status`, remark, ext_1, ", |
|
|
|
|
"ext_2, ext_3", |
|
|
|
|
"from cms_category", |
|
|
|
|
"where id = #{id,jdbcType=BIGINT}" |
|
|
|
|
}) |
|
|
|
|
@Results({ |
|
|
|
|
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
|
|
|
|
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
|
|
|
|
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT), |
|
|
|
|
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
|
|
|
|
@Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), |
|
|
|
@ -94,7 +108,8 @@ public interface CmsCategoryMapper extends CmsCategoryMapperExt { |
|
|
|
|
|
|
|
|
|
@Update({ |
|
|
|
|
"update cms_category", |
|
|
|
|
"set parent_id = #{parentId,jdbcType=BIGINT},", |
|
|
|
|
"set `type` = #{type,jdbcType=INTEGER},", |
|
|
|
|
"parent_id = #{parentId,jdbcType=BIGINT},", |
|
|
|
|
"`name` = #{name,jdbcType=VARCHAR},", |
|
|
|
|
"code = #{code,jdbcType=VARCHAR},", |
|
|
|
|
"sort = #{sort,jdbcType=INTEGER},", |
|
|
|
|