规范代码格式,采用generatorConfig.xml执行下就能自动生成

This commit is contained in:
季圣华
2019-04-30 23:13:17 +08:00
parent 1f628d7537
commit 38dbf19b22
7 changed files with 137 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
<?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">
<?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.jsh.erp.datasource.mappers.DepotMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Depot">
<!--
@@ -17,7 +17,7 @@
<result column="principal" jdbcType="BIGINT" property="principal" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="IsDefault" jdbcType="BIT" property="isdefault" />
<result column="is_default" jdbcType="BIT" property="isDefault" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@@ -90,8 +90,8 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
delete_Flag,IsDefault
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
delete_Flag, is_default
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap">
<!--
@@ -116,7 +116,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<include refid="Base_Column_List" />
from jsh_depot
where id = #{id,jdbcType=BIGINT}
@@ -144,14 +144,16 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_depot (id, name, address,
warehousing, truckage, type,
sort, remark, principal,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
insert into jsh_depot (id, name, address,
warehousing, truckage, type,
sort, remark, principal,
tenant_id, delete_Flag, is_default
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}, #{isDefault,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Depot">
<!--
@@ -193,6 +195,9 @@
<if test="deleteFlag != null">
delete_Flag,
</if>
<if test="isDefault != null">
is_default,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -228,6 +233,9 @@
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
<if test="isDefault != null">
#{isDefault,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultType="java.lang.Integer">
@@ -280,8 +288,8 @@
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
<if test="record.isdefault != null">
IsDefault = #{record.isdefault,jdbcType=BIT},
<if test="record.isDefault != null">
is_default = #{record.isDefault,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
@@ -304,7 +312,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
principal = #{record.principal,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
is_default = #{record.isDefault,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -346,6 +355,9 @@
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
<if test="isDefault != null">
is_default = #{isDefault,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@@ -364,7 +376,8 @@
remark = #{remark,jdbcType=VARCHAR},
principal = #{principal,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
is_default = #{isDefault,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
</mapper>