给多单位再增加两个副单位

This commit is contained in:
季圣华
2021-12-01 00:58:54 +08:00
parent c0ee413c8f
commit 5df71b26db
11 changed files with 449 additions and 61 deletions

View File

@@ -32,10 +32,6 @@
<result column="enable_batch_number" jdbcType="VARCHAR" property="enableBatchNumber" />
<result column="DepotName" jdbcType="VARCHAR" property="DepotName" />
<result column="AnotherDepotName" jdbcType="VARCHAR" property="AnotherDepotName" />
<result column="UnitId" jdbcType="BIGINT" property="UnitId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="ratio" jdbcType="INTEGER" property="ratio" />
<result column="other_unit" jdbcType="INTEGER" property="otherUnit" />
<result column="barCode" jdbcType="VARCHAR" property="barCode" />
</resultMap>
@@ -180,11 +176,10 @@
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.name MName,m.model MModel,m.unit MaterialUnit,m.color MColor,m.standard MStandard,m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,m.enable_serial_number, m.enable_batch_number,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio, u.other_unit, me.bar_code barCode
dp1.name DepotName,dp2.name AnotherDepotName, me.bar_code barCode
from jsh_depot_item di
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_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_depot dp1 on di.depot_id=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.another_depot_id=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.header_id = #{headerId}

View File

@@ -143,7 +143,7 @@
</foreach>
</if>
and ifnull(m.delete_flag,'0') !='1'
ORDER BY m.id desc,me.default_flag desc
ORDER BY m.id desc, me.default_flag desc, me.id asc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>

View File

@@ -6,7 +6,11 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="basic_unit" jdbcType="VARCHAR" property="basicUnit" />
<result column="other_unit" jdbcType="VARCHAR" property="otherUnit" />
<result column="other_unit_two" jdbcType="VARCHAR" property="otherUnitTwo" />
<result column="other_unit_three" jdbcType="VARCHAR" property="otherUnitThree" />
<result column="ratio" jdbcType="INTEGER" property="ratio" />
<result column="ratio_two" jdbcType="INTEGER" property="ratioTwo" />
<result column="ratio_three" jdbcType="INTEGER" property="ratioThree" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
@@ -69,7 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, basic_unit, other_unit, ratio, tenant_id, delete_flag
id, name, basic_unit, other_unit, other_unit_two, other_unit_three, ratio, ratio_two,
ratio_three, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UnitExample" resultMap="BaseResultMap">
select
@@ -103,11 +108,13 @@
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Unit">
insert into jsh_unit (id, name, basic_unit,
other_unit, ratio, tenant_id,
delete_flag)
other_unit, other_unit_two, other_unit_three,
ratio, ratio_two, ratio_three,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{basicUnit,jdbcType=VARCHAR},
#{otherUnit,jdbcType=VARCHAR}, #{ratio,jdbcType=INTEGER}, #{tenantId,jdbcType=BIGINT},
#{deleteFlag,jdbcType=VARCHAR})
#{otherUnit,jdbcType=VARCHAR}, #{otherUnitTwo,jdbcType=VARCHAR}, #{otherUnitThree,jdbcType=VARCHAR},
#{ratio,jdbcType=INTEGER}, #{ratioTwo,jdbcType=INTEGER}, #{ratioThree,jdbcType=INTEGER},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Unit">
insert into jsh_unit
@@ -124,9 +131,21 @@
<if test="otherUnit != null">
other_unit,
</if>
<if test="otherUnitTwo != null">
other_unit_two,
</if>
<if test="otherUnitThree != null">
other_unit_three,
</if>
<if test="ratio != null">
ratio,
</if>
<if test="ratioTwo != null">
ratio_two,
</if>
<if test="ratioThree != null">
ratio_three,
</if>
<if test="tenantId != null">
tenant_id,
</if>
@@ -147,9 +166,21 @@
<if test="otherUnit != null">
#{otherUnit,jdbcType=VARCHAR},
</if>
<if test="otherUnitTwo != null">
#{otherUnitTwo,jdbcType=VARCHAR},
</if>
<if test="otherUnitThree != null">
#{otherUnitThree,jdbcType=VARCHAR},
</if>
<if test="ratio != null">
#{ratio,jdbcType=INTEGER},
</if>
<if test="ratioTwo != null">
#{ratioTwo,jdbcType=INTEGER},
</if>
<if test="ratioThree != null">
#{ratioThree,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
@@ -179,9 +210,21 @@
<if test="record.otherUnit != null">
other_unit = #{record.otherUnit,jdbcType=VARCHAR},
</if>
<if test="record.otherUnitTwo != null">
other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR},
</if>
<if test="record.otherUnitThree != null">
other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR},
</if>
<if test="record.ratio != null">
ratio = #{record.ratio,jdbcType=INTEGER},
</if>
<if test="record.ratioTwo != null">
ratio_two = #{record.ratioTwo,jdbcType=INTEGER},
</if>
<if test="record.ratioThree != null">
ratio_three = #{record.ratioThree,jdbcType=INTEGER},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
@@ -199,7 +242,11 @@
name = #{record.name,jdbcType=VARCHAR},
basic_unit = #{record.basicUnit,jdbcType=VARCHAR},
other_unit = #{record.otherUnit,jdbcType=VARCHAR},
other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR},
other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR},
ratio = #{record.ratio,jdbcType=INTEGER},
ratio_two = #{record.ratioTwo,jdbcType=INTEGER},
ratio_three = #{record.ratioThree,jdbcType=INTEGER},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
@@ -218,9 +265,21 @@
<if test="otherUnit != null">
other_unit = #{otherUnit,jdbcType=VARCHAR},
</if>
<if test="otherUnitTwo != null">
other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR},
</if>
<if test="otherUnitThree != null">
other_unit_three = #{otherUnitThree,jdbcType=VARCHAR},
</if>
<if test="ratio != null">
ratio = #{ratio,jdbcType=INTEGER},
</if>
<if test="ratioTwo != null">
ratio_two = #{ratioTwo,jdbcType=INTEGER},
</if>
<if test="ratioThree != null">
ratio_three = #{ratioThree,jdbcType=INTEGER},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
@@ -235,7 +294,11 @@
set name = #{name,jdbcType=VARCHAR},
basic_unit = #{basicUnit,jdbcType=VARCHAR},
other_unit = #{otherUnit,jdbcType=VARCHAR},
other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR},
other_unit_three = #{otherUnitThree,jdbcType=VARCHAR},
ratio = #{ratio,jdbcType=INTEGER},
ratio_two = #{ratioTwo,jdbcType=INTEGER},
ratio_three = #{ratioThree,jdbcType=INTEGER},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}