给商品相关的模块优化接口

This commit is contained in:
jishenghua
2025-02-23 14:49:34 +08:00
parent db090f8dd5
commit 8e3a971a04
30 changed files with 413 additions and 714 deletions

View File

@@ -16,16 +16,6 @@
</if>
</select>
<select id="countsByMaterialAttribute" resultType="java.lang.Long">
SELECT count(ma.id) from jsh_material_attribute ma
where 1=1
<if test="attributeName != null">
<bind name="bindAttributeName" value="'%'+attributeName+'%'"/>
and ma.attribute_name like #{bindAttributeName}
</if>
and ifnull(ma.delete_flag,'0') !='1'
</select>
<update id="batchDeleteMaterialAttributeByIds">
update jsh_material_attribute
set delete_flag='1'

View File

@@ -107,79 +107,6 @@
and ifnull(m.delete_flag,'0') !='1'
group by m.id
order by m.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByMaterial" resultType="java.lang.Long">
SELECT
COUNT(m.id)
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'
WHERE 1=1
and me.default_flag=1
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey}
or m.model like #{bindKey} or m.color like #{bindKey} or m.brand like #{bindKey} or m.mfrs like #{bindKey})
</if>
<if test="standard != null and standard !=''">
<bind name="bindStandard" value="'%'+standard+'%'"/>
and m.standard like #{bindStandard}
</if>
<if test="model != null and model !=''">
<bind name="bindModel" value="'%'+model+'%'"/>
and m.model like #{bindModel}
</if>
<if test="color != null and color !=''">
<bind name="bindColor" value="'%'+color+'%'"/>
and m.color like #{bindColor}
</if>
<if test="brand != null and brand !=''">
<bind name="bindBrand" value="'%'+brand+'%'"/>
and m.brand like #{bindBrand}
</if>
<if test="mfrs != null and mfrs !=''">
<bind name="bindMfrs" value="'%'+mfrs+'%'"/>
and m.mfrs like #{bindMfrs}
</if>
<if test="materialOther != null and materialOther !=''">
<bind name="bindOther" value="'%'+materialOther+'%'"/>
and (m.other_field1 like #{bindOther} or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if test="weight != null and weight !=''">
and m.weight = #{weight}
</if>
<if test="expiryNum != null and expiryNum !=''">
and m.expiry_num = #{expiryNum}
</if>
<if test="enableSerialNumber != null and enableSerialNumber !=''">
and m.enable_serial_number = #{enableSerialNumber}
</if>
<if test="enableBatchNumber != null and enableBatchNumber !=''">
and m.enable_batch_number = #{enableBatchNumber}
</if>
<if test="position != null and position !=''">
<bind name="bindPosition" value="'%'+position+'%'"/>
and m.position like #{bindPosition}
</if>
<if test="enabled != null and enabled !=''">
and m.enabled = #{enabled}
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and m.remark like #{bindRemark}
</if>
<if test="idList.size()>0">
and m.category_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
and ifnull(m.delete_flag,'0') !='1'
</select>
<insert id="insertSelectiveEx" parameterType="com.jsh.erp.datasource.entities.Material" useGeneratedKeys="true" keyProperty="id">

View File

@@ -10,21 +10,8 @@
and native_name like #{bindName}
</if>
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByMaterialProperty" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_material_property
WHERE 1=1
<if test="name != null">
<bind name="bindName" value="'%'+name+'%'"/>
and native_name like #{bindName}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteMaterialPropertyByIds">
update jsh_material_property
set delete_flag='1'