给商品扩展表增加‘是否默认基础单位’字段

This commit is contained in:
季圣华
2020-04-25 11:39:16 +08:00
parent 2965a441b7
commit 5774580b0b
9 changed files with 630 additions and 16 deletions

View File

@@ -10,6 +10,7 @@
<result column="commodity_decimal" jdbcType="DECIMAL" property="commodityDecimal" />
<result column="wholesale_decimal" jdbcType="DECIMAL" property="wholesaleDecimal" />
<result column="low_decimal" jdbcType="DECIMAL" property="lowDecimal" />
<result column="default_flag" jdbcType="VARCHAR" property="defaultFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_serial" jdbcType="VARCHAR" property="createSerial" />
<result column="update_serial" jdbcType="VARCHAR" property="updateSerial" />
@@ -77,7 +78,8 @@
</sql>
<sql id="Base_Column_List">
id, material_id, bar_code, commodity_unit, purchase_decimal, commodity_decimal, wholesale_decimal,
low_decimal, create_time, create_serial, update_serial, update_time, tenant_id, delete_Flag
low_decimal, default_flag, create_time, create_serial, update_serial, update_time,
tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="BaseResultMap">
select
@@ -112,14 +114,16 @@
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
insert into jsh_material_extend (id, material_id, bar_code,
commodity_unit, purchase_decimal, commodity_decimal,
wholesale_decimal, low_decimal, create_time,
create_serial, update_serial, update_time,
tenant_id, delete_Flag)
wholesale_decimal, low_decimal, default_flag,
create_time, create_serial, update_serial,
update_time, tenant_id, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR},
#{commodityUnit,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL}, #{commodityDecimal,jdbcType=DECIMAL},
#{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
#{createSerial,jdbcType=VARCHAR}, #{updateSerial,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
#{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL}, #{defaultFlag,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR}, #{updateSerial,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
insert into jsh_material_extend
@@ -148,6 +152,9 @@
<if test="lowDecimal != null">
low_decimal,
</if>
<if test="defaultFlag != null">
default_flag,
</if>
<if test="createTime != null">
create_time,
</if>
@@ -192,6 +199,9 @@
<if test="lowDecimal != null">
#{lowDecimal,jdbcType=DECIMAL},
</if>
<if test="defaultFlag != null">
#{defaultFlag,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
@@ -245,6 +255,9 @@
<if test="record.lowDecimal != null">
low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
</if>
<if test="record.defaultFlag != null">
default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
@@ -278,6 +291,7 @@
commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_serial = #{record.createSerial,jdbcType=VARCHAR},
update_serial = #{record.updateSerial,jdbcType=VARCHAR},
@@ -312,6 +326,9 @@
<if test="lowDecimal != null">
low_decimal = #{lowDecimal,jdbcType=DECIMAL},
</if>
<if test="defaultFlag != null">
default_flag = #{defaultFlag,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
@@ -342,6 +359,7 @@
commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
low_decimal = #{lowDecimal,jdbcType=DECIMAL},
default_flag = #{defaultFlag,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_serial = #{createSerial,jdbcType=VARCHAR},
update_serial = #{updateSerial,jdbcType=VARCHAR},

View File

@@ -10,7 +10,7 @@
from jsh_material_extend d
where d.material_id = '${materialId}'
and ifnull(d.delete_Flag,'0') !='1'
order by d.id asc
order by d.default_flag desc,d.id asc
</select>
<select id="getMaxTimeByTenantAndTime" resultType="java.lang.Long">