给单据增加sku字段

This commit is contained in:
季圣华
2021-07-28 00:54:30 +08:00
parent f073488317
commit 1f166552b2
9 changed files with 141 additions and 27 deletions

View File

@@ -7,6 +7,7 @@
<result column="material_id" jdbcType="BIGINT" property="materialId" />
<result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" />
<result column="material_unit" jdbcType="VARCHAR" property="materialUnit" />
<result column="sku" jdbcType="VARCHAR" property="sku" />
<result column="oper_number" jdbcType="DECIMAL" property="operNumber" />
<result column="basic_number" jdbcType="DECIMAL" property="basicNumber" />
<result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
@@ -81,9 +82,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, header_id, material_id, material_extend_id, material_unit, oper_number, basic_number,
unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id, tax_rate,
tax_money, tax_last_money, material_type, tenant_id, delete_flag
id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id,
tax_rate, tax_money, tax_last_money, material_type, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
select
@@ -117,19 +118,19 @@
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depot_item (id, header_id, material_id,
material_extend_id, material_unit, oper_number,
basic_number, unit_price, tax_unit_price,
all_price, remark, depot_id,
another_depot_id, tax_rate, tax_money,
tax_last_money, material_type, tenant_id,
delete_flag)
material_extend_id, material_unit, sku,
oper_number, basic_number, unit_price,
tax_unit_price, all_price, remark,
depot_id, another_depot_id, tax_rate,
tax_money, tax_last_money, material_type,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{operNumber,jdbcType=DECIMAL},
#{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL}, #{taxUnitPrice,jdbcType=DECIMAL},
#{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{depotId,jdbcType=BIGINT},
#{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL}, #{taxMoney,jdbcType=DECIMAL},
#{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT},
#{deleteFlag,jdbcType=VARCHAR})
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
#{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
#{taxUnitPrice,jdbcType=DECIMAL}, #{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL},
#{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depot_item
@@ -149,6 +150,9 @@
<if test="materialUnit != null">
material_unit,
</if>
<if test="sku != null">
sku,
</if>
<if test="operNumber != null">
oper_number,
</if>
@@ -208,6 +212,9 @@
<if test="materialUnit != null">
#{materialUnit,jdbcType=VARCHAR},
</if>
<if test="sku != null">
#{sku,jdbcType=VARCHAR},
</if>
<if test="operNumber != null">
#{operNumber,jdbcType=DECIMAL},
</if>
@@ -276,6 +283,9 @@
<if test="record.materialUnit != null">
material_unit = #{record.materialUnit,jdbcType=VARCHAR},
</if>
<if test="record.sku != null">
sku = #{record.sku,jdbcType=VARCHAR},
</if>
<if test="record.operNumber != null">
oper_number = #{record.operNumber,jdbcType=DECIMAL},
</if>
@@ -330,6 +340,7 @@
material_id = #{record.materialId,jdbcType=BIGINT},
material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
material_unit = #{record.materialUnit,jdbcType=VARCHAR},
sku = #{record.sku,jdbcType=VARCHAR},
oper_number = #{record.operNumber,jdbcType=DECIMAL},
basic_number = #{record.basicNumber,jdbcType=DECIMAL},
unit_price = #{record.unitPrice,jdbcType=DECIMAL},
@@ -363,6 +374,9 @@
<if test="materialUnit != null">
material_unit = #{materialUnit,jdbcType=VARCHAR},
</if>
<if test="sku != null">
sku = #{sku,jdbcType=VARCHAR},
</if>
<if test="operNumber != null">
oper_number = #{operNumber,jdbcType=DECIMAL},
</if>
@@ -414,6 +428,7 @@
material_id = #{materialId,jdbcType=BIGINT},
material_extend_id = #{materialExtendId,jdbcType=BIGINT},
material_unit = #{materialUnit,jdbcType=VARCHAR},
sku = #{sku,jdbcType=VARCHAR},
oper_number = #{operNumber,jdbcType=DECIMAL},
basic_number = #{basicNumber,jdbcType=DECIMAL},
unit_price = #{unitPrice,jdbcType=DECIMAL},

View File

@@ -25,6 +25,7 @@
<resultMap extends="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap" id="ResultAndUnitMap" type="com.jsh.erp.datasource.entities.MaterialVo4Unit">
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="sku" jdbcType="VARCHAR" property="sku" />
</resultMap>
<select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
@@ -124,7 +125,7 @@
</select>
<select id="findBySelectWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name,mc.name categoryName,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m
select m.*,u.name unit_name,mc.name categoryName,me.bar_code m_bar_code,me.id meId,me.commodity_unit,me.sku from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
@@ -302,7 +303,7 @@
<select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name,me.bar_code m_bar_code, me.commodity_unit, me.purchase_decimal, me.commodity_decimal,
me.wholesale_decimal, me.low_decimal
me.wholesale_decimal, me.low_decimal, me.sku
from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'