给报表中增加单位

This commit is contained in:
季圣华
2021-08-07 21:13:29 +08:00
parent 491a74e424
commit a7d6c71e45
4 changed files with 17 additions and 4 deletions

View File

@@ -30,6 +30,7 @@
<result column="Model" jdbcType="VARCHAR" property="Model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" />
<result column="numSum" jdbcType="DECIMAL" property="numSum" />
<result column="priceSum" jdbcType="DECIMAL" property="priceSum" />
</resultMap>
@@ -228,7 +229,7 @@
</select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.material_id, m.bar_code, m.mName,m.Model,m.standard,m.categoryName,
select di.material_id, m.bar_code, m.mName,m.Model,m.standard,m.categoryName,m.materialUnit,
(select sum(jdi.basic_number) numSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
@@ -255,8 +256,10 @@
) priceSum
from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, me.bar_code, Model, standard, jsh_material_category.`Name` categoryName
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, me.bar_code, Model, standard,
jsh_material_category.`Name` categoryName, concat_ws('', jsh_material.unit, u.basic_unit) materialUnit
from jsh_material
left join jsh_unit u on jsh_material.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.material_id=jsh_material.id and ifnull(me.delete_Flag,'0') !='1'
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
where me.default_flag=1 and ifnull(jsh_material.delete_Flag,'0') !='1'

View File

@@ -178,7 +178,7 @@
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
m.unit MaterialUnit, m.color MColor, u.name unit_name,
concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, u.name unit_name,
(select purchase_decimal from jsh_material_extend me
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
purchase_decimal