select
m.id,m.type,m.json,m.create_time,bb.consume,bb.type as bomType,bb.price
from
mm.material_store m
left join sd.bom_base as bb on bb.material_id=m.id
and m.id regexp #{materialStore.id}
and m.type regexp #{materialStore.type}
order by m.id desc
limit #{offset},#{pageSize};
select
m.id,m.type,m.json,m.create_time,bb.consume,bb.type as bomType,bb.price,bb.id as tabId
from
sd.bom_base as bb
left join mm.material_store m on bb.material_id=m.id
and m.id regexp #{materialStore.id}
and m.type regexp #{materialStore.type}
order by m.id desc
limit #{offset},#{pageSize};
select
*
from
mm.material_store m
and m.id regexp #{materialStore.id}
and m.type regexp #{materialStore.type}
order by m.id desc
select * from mm.material_store m where id=#{id}
select
CEILING(count(id)/#{pageSize}) as 'pageTotal',
count(id) as 'total'
from
mm.material_store m
and m.id regexp #{materialStore.id}
and m.type regexp #{materialStore.type}
limit #{offset},#{pageSize};
insert into mm.material_store (type,json,create_time
)
values (
#{type},#{json},now()
)
update mm.material_store set json=#{json} where id=#{id}
delete from mm.material_store where id=#{id}
select count(*) from mm.material_inventory where material_code=#{id}
select count(*) from mm.material_store where json=#{json}