1.6 do mapper 初始化

This commit is contained in:
苏竹红
2023-11-30 13:52:01 +08:00
parent 49964a5168
commit 7cbca135f3
9 changed files with 878 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyExhibitionGroupDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
public interface HyExhibitionGroupMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:36
*/
int insertSelective( HyExhibitionGroupDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:36
*/
HyExhibitionGroupDO selectByPrimaryKey(Integer id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:36
*/
int updateByPrimaryKeySelective(HyExhibitionGroupDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:36
*/
int deleteByPrimaryKey(Integer id);
}

View File

@@ -0,0 +1,40 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyExhibitionDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:47
*/
public interface HyExhibitionMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:38
*/
int insertSelective(HyExhibitionDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:38
*/
HyExhibitionDO selectByPrimaryKey(Integer id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:38
*/
int updateByPrimaryKeySelective(HyExhibitionDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:38
*/
int deleteByPrimaryKey(Integer id);
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerExhibitionDO;
import tk.mybatis.mapper.common.Mapper;
/**
* @author zhangchenbiao
* @date 2023-11-30 11:55
*/
public interface HyPartnerExhibitionMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-11-30 01:39
*/
int insertSelective(HyPartnerExhibitionDO record);
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2023-11-30 01:39
*/
HyPartnerExhibitionDO selectByPrimaryKey(Long id);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-11-30 01:39
*/
int updateByPrimaryKeySelective(HyPartnerExhibitionDO record);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2023-11-30 01:39
*/
int deleteByPrimaryKey(Long id);
}

View File

@@ -0,0 +1,135 @@
<?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.cool.store.mapper.HyExhibitionGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyExhibitionGroupDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="exhibition_group_name" jdbcType="VARCHAR" property="exhibitionGroupName" />
<result column="closed" jdbcType="BIT" property="closed" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_group_name, closed, create_time, update_time, creator, updater, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_exhibition_group
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from hy_exhibition_group
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into hy_exhibition_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupName != null">
exhibition_group_name,
</if>
<if test="closed != null">
closed,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupName != null">
#{exhibitionGroupName,jdbcType=VARCHAR},
</if>
<if test="closed != null">
#{closed,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO">
update hy_exhibition_group
<set>
<if test="exhibitionGroupName != null">
exhibition_group_name = #{exhibitionGroupName,jdbcType=VARCHAR},
</if>
<if test="closed != null">
closed = #{closed,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=INTEGER}
</if>
<if test="null != exhibitionGroupName">
and t.exhibition_group_name = #{exhibitionGroupName,jdbcType=VARCHAR}
</if>
<if test="null != closed">
and t.closed = #{closed,jdbcType=BIT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
</trim>
</sql>
</mapper>

View File

@@ -0,0 +1,220 @@
<?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.cool.store.mapper.HyExhibitionMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyExhibitionDO">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="exhibition_group_id" jdbcType="INTEGER" property="exhibitionGroupId" />
<result column="exhibition_code" jdbcType="VARCHAR" property="exhibitionCode" />
<result column="exhibition_name" jdbcType="VARCHAR" property="exhibitionName" />
<result column="start_date" jdbcType="DATE" property="startDate" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="closed_type" jdbcType="TINYINT" property="closedType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="close_time" jdbcType="TIMESTAMP" property="closeTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyExhibitionDO">
<result column="collaborators" jdbcType="LONGVARCHAR" property="collaborators" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_group_id, exhibition_code, exhibition_name, start_date, location,
closed_type, create_time, update_time, creator, updater, deleted, close_time
</sql>
<sql id="Blob_Column_List">
collaborators
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from hy_exhibition
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from hy_exhibition
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into hy_exhibition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupId != null">
exhibition_group_id,
</if>
<if test="exhibitionCode != null">
exhibition_code,
</if>
<if test="exhibitionName != null">
exhibition_name,
</if>
<if test="startDate != null">
start_date,
</if>
<if test="location != null">
location,
</if>
<if test="closedType != null">
closed_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="closeTime != null">
close_time,
</if>
<if test="collaborators != null">
collaborators,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionGroupId != null">
#{exhibitionGroupId,jdbcType=INTEGER},
</if>
<if test="exhibitionCode != null">
#{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="exhibitionName != null">
#{exhibitionName,jdbcType=VARCHAR},
</if>
<if test="startDate != null">
#{startDate,jdbcType=DATE},
</if>
<if test="location != null">
#{location,jdbcType=VARCHAR},
</if>
<if test="closedType != null">
#{closedType,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
<if test="closeTime != null">
#{closeTime,jdbcType=TIMESTAMP},
</if>
<if test="collaborators != null">
#{collaborators,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyExhibitionDO">
update hy_exhibition
<set>
<if test="exhibitionGroupId != null">
exhibition_group_id = #{exhibitionGroupId,jdbcType=INTEGER},
</if>
<if test="exhibitionCode != null">
exhibition_code = #{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="exhibitionName != null">
exhibition_name = #{exhibitionName,jdbcType=VARCHAR},
</if>
<if test="startDate != null">
start_date = #{startDate,jdbcType=DATE},
</if>
<if test="location != null">
location = #{location,jdbcType=VARCHAR},
</if>
<if test="closedType != null">
closed_type = #{closedType,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
<if test="closeTime != null">
close_time = #{closeTime,jdbcType=TIMESTAMP},
</if>
<if test="collaborators != null">
collaborators = #{collaborators,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=INTEGER}
</if>
<if test="null != exhibitionGroupId">
and t.exhibition_group_id = #{exhibitionGroupId,jdbcType=INTEGER}
</if>
<if test="null != exhibitionCode">
and t.exhibition_code = #{exhibitionCode,jdbcType=VARCHAR}
</if>
<if test="null != exhibitionName">
and t.exhibition_name = #{exhibitionName,jdbcType=VARCHAR}
</if>
<if test="null != startDate">
and t.start_date = #{startDate,jdbcType=DATE}
</if>
<if test="null != location">
and t.location = #{location,jdbcType=VARCHAR}
</if>
<if test="null != closedType">
and t.closed_type = #{closedType,jdbcType=TINYINT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
<if test="null != closeTime">
and t.close_time = #{closeTime,jdbcType=TIMESTAMP}
</if>
<if test="null != collaborators">
and t.collaborators = #{collaborators,jdbcType=LONGVARCHAR}
</if>
</trim>
</sql>
</mapper>

View File

@@ -0,0 +1,227 @@
<?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.cool.store.mapper.HyPartnerExhibitionMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerExhibitionDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="exhibition_code" jdbcType="VARCHAR" property="exhibitionCode" />
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="want_shop_area" jdbcType="VARCHAR" property="wantShopArea" />
<result column="investment_manager_name" jdbcType="VARCHAR" property="investmentManagerName" />
<result column="expected_visitors_count" jdbcType="INTEGER" property="expectedVisitorsCount" />
<result column="expected_information" jdbcType="VARCHAR" property="expectedInformation" />
<result column="participation_status" jdbcType="TINYINT" property="participationStatus" />
<result column="interview_plan_id" jdbcType="BIGINT" property="interviewPlanId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
id, exhibition_code, partner_line_id, partner_id, want_shop_area, investment_manager_name,
expected_visitors_count, expected_information, participation_status, interview_plan_id,
create_time, update_time, creator, updater, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_exhibition
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_exhibition
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerExhibitionDO">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into hy_partner_exhibition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exhibitionCode != null">
exhibition_code,
</if>
<if test="partnerLineId != null">
partner_line_id,
</if>
<if test="partnerId != null">
partner_id,
</if>
<if test="wantShopArea != null">
want_shop_area,
</if>
<if test="investmentManagerName != null">
investment_manager_name,
</if>
<if test="expectedVisitorsCount != null">
expected_visitors_count,
</if>
<if test="expectedInformation != null">
expected_information,
</if>
<if test="participationStatus != null">
participation_status,
</if>
<if test="interviewPlanId != null">
interview_plan_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="updater != null">
updater,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exhibitionCode != null">
#{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="partnerLineId != null">
#{partnerLineId,jdbcType=BIGINT},
</if>
<if test="partnerId != null">
#{partnerId,jdbcType=VARCHAR},
</if>
<if test="wantShopArea != null">
#{wantShopArea,jdbcType=VARCHAR},
</if>
<if test="investmentManagerName != null">
#{investmentManagerName,jdbcType=VARCHAR},
</if>
<if test="expectedVisitorsCount != null">
#{expectedVisitorsCount,jdbcType=INTEGER},
</if>
<if test="expectedInformation != null">
#{expectedInformation,jdbcType=VARCHAR},
</if>
<if test="participationStatus != null">
#{participationStatus,jdbcType=TINYINT},
</if>
<if test="interviewPlanId != null">
#{interviewPlanId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerExhibitionDO">
update hy_partner_exhibition
<set>
<if test="exhibitionCode != null">
exhibition_code = #{exhibitionCode,jdbcType=VARCHAR},
</if>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId,jdbcType=BIGINT},
</if>
<if test="partnerId != null">
partner_id = #{partnerId,jdbcType=VARCHAR},
</if>
<if test="wantShopArea != null">
want_shop_area = #{wantShopArea,jdbcType=VARCHAR},
</if>
<if test="investmentManagerName != null">
investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR},
</if>
<if test="expectedVisitorsCount != null">
expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER},
</if>
<if test="expectedInformation != null">
expected_information = #{expectedInformation,jdbcType=VARCHAR},
</if>
<if test="participationStatus != null">
participation_status = #{participationStatus,jdbcType=TINYINT},
</if>
<if test="interviewPlanId != null">
interview_plan_id = #{interviewPlanId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="updater != null">
updater = #{updater,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=BIGINT}
</if>
<if test="null != exhibitionCode">
and t.exhibition_code = #{exhibitionCode,jdbcType=VARCHAR}
</if>
<if test="null != partnerLineId">
and t.partner_line_id = #{partnerLineId,jdbcType=BIGINT}
</if>
<if test="null != partnerId">
and t.partner_id = #{partnerId,jdbcType=VARCHAR}
</if>
<if test="null != wantShopArea">
and t.want_shop_area = #{wantShopArea,jdbcType=VARCHAR}
</if>
<if test="null != investmentManagerName">
and t.investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR}
</if>
<if test="null != expectedVisitorsCount">
and t.expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER}
</if>
<if test="null != expectedInformation">
and t.expected_information = #{expectedInformation,jdbcType=VARCHAR}
</if>
<if test="null != participationStatus">
and t.participation_status = #{participationStatus,jdbcType=TINYINT}
</if>
<if test="null != interviewPlanId">
and t.interview_plan_id = #{interviewPlanId,jdbcType=BIGINT}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
<if test="null != creator">
and t.creator = #{creator,jdbcType=VARCHAR}
</if>
<if test="null != updater">
and t.updater = #{updater,jdbcType=VARCHAR}
</if>
<if test="null != deleted">
and t.deleted = #{deleted,jdbcType=BIT}
</if>
</trim>
</sql>
</mapper>