select m.*,u.uname unitName, mc.name categoryName
FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id
where 1=1
and m.name like '%${name}%'
and m.model like '%${model}%'
and m.CategoryId in (${categoryIds})
order by m.id asc
limit #{offset},#{rows}
SELECT
COUNT(m.id)
FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id
WHERE 1=1
and m.name like '%${name}%'
and m.model like '%${model}%'
and m.CategoryId in (${categoryIds})
select jsh_unit.UName from jsh_unit left join jsh_material on UnitId=jsh_unit.id where jsh_material.id = ${mId}
select m.*,u.UName from jsh_material m left join jsh_unit u on m.UnitId=u.id where m.id = ${id}
select m.*,u.UName from jsh_material m left join jsh_unit u on m.UnitId=u.id where m.enabled=1 ORDER BY Id asc
update jsh_material
set
RetailPrice = null,
LowPrice = null,
PresetPriceOne = null,
PresetPriceTwo = null
where Id = #{id,jdbcType=BIGINT}
update jsh_material
set
UnitId = null
where Id = #{id,jdbcType=BIGINT}
select m.*,u.uname unitName, mc.name categoryName
FROM jsh_material m
left JOIN jsh_unit u on m.UnitId = u.id
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id
where 1=1
and m.name like '%${name}%'
and m.model like '%${model}%'
and m.CategoryId in (${categoryIds})
order by m.id asc