select count(1) from safe_material_detail
select id,
CONCAT(name,'(ID',sm_id,')') as name,
material_no,
big_classify_id,
rfid,
consumable,
valid_type,
valid_time,
valid_status,
ir_status,
ware_housing_time,
ware_housing_time,
delivery_time,
sm_id,
claimant_id,
claimant_name
from safe_material_detail where del_flag = 0 and id = #{id}
update safe_material_detail
set ir_status = #{status},
ware_housing_time = #{wareHousingTime},
claimant_id = null,
claimant_name = null
where id = #{id}
select id,name,material_no,big_classify_id,rfid,consumable,valid_type,valid_time,valid_status,ir_status,ware_housing_time,ware_housing_time,delivery_time,sm_id,claimant_id,claimant_name
from safe_material_detail
where del_flag = 0
and id in
#{id}
update safe_material_detail
set ir_status = #{irStatus},
ware_housing_time = #{wareHousingTime},
claimant_id = null,
claimant_name = null where id in
#{id}
select smId,count(*)
from safe_material_detail
where del_flag = 0
and ir_status = #{irStatus}
and id in
#{id}
group by smId
select count(1) as count,
sm_id
from safe_material_detail
where del_flag = 0
and valid_status = #{validStatus}
and ir_status = #{irStatus}
and sm_id in
#{smId}
GROUP BY
sm_id
update safe_material_detail set del_flag = 1 where id in
#{id}
update safe_material_detail
set ir_status = #{detailBO.irStatus},
claimant_id = #{detailBO.claimantId},
claimant_name = #{detailBO.claimantName},
delivery_time = #{detailBO.deliveryTime}
where id in
#{id}
update safe_material_detail
set ir_status = #{detailBO.irStatus},
claimant_id = #{detailBO.claimantId},
claimant_name = #{detailBO.claimantName},
delivery_time = #{detailBO.deliveryTime}
where id in
#{id}
select count(1)
from safe_material_detail
where del_flag = 0
and valid_status = #{validStatus}
and ir_status = #{irStatus}
and sm_id = #{smId}
select sd.id,
CONCAT(sd.name,'(ID',sd.sm_id,')') as name,
sd.material_no,
sd.big_classify_id,
sd.rfid,
sd.consumable,
sd.valid_type,
sd.valid_time,
sd.valid_status,
sd.ir_status,
sd.ware_housing_time,
sd.claimant_name,
sd.delivery_time,
sm.dep_id,
sm.dep_name,
sd.sm_id,
sc.material_classify_name as bigClassifyName
from safe_material_detail sd
INNER JOIN safe_material_classify sc on sd.big_classify_id = sc.id
INNER JOIN safe_material sm on sd.sm_id = sm.id
where sd.del_flag = 0
and sd.rfid = #{query.rfid}
and sd.ir_status = #{query.irStatus}
ORDER BY sd.create_time desc
select count(1) from safe_material_detail where del_flag = 0 and sm_id = #{smId}
select count(1) from safe_material_detail where del_flag = 0 and sm_id in
#{smId}
update safe_material_detail set valid_status = #{validStatus} where id = #{id}
select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is not null ORDER BY ware_housing_time asc LIMIT #{count}
select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is null ORDER BY ware_housing_time asc LIMIT #{count}
select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid = #{rfid} ORDER BY ware_housing_time asc LIMIT #{count}
select d.small_classify_id,
m.dep_id,
m.dep_name,
count(1) as stockCount
from safe_material_detail d
INNER JOIN safe_material m
ON d.sm_id = m.id
where d.del_flag = 0
and d.ir_status = 0
and d.valid_status = 0
and d.small_classify_id in
#{smallClassifyId}
group By d.small_classify_id,m.dep_id,m.dep_name
SELECT
sd.id,
sd.rfid,
sm.dep_id,
sd.small_classify_id,
sd.big_classify_id
FROM
safe_material_detail sd
INNER JOIN safe_material sm ON sd.sm_id = sm.id
WHERE
sd.del_flag = 0
AND sd.ir_status = 0
AND sd.valid_status = 0
AND sd.small_classify_id IN
#{smallClassifyId}
AND sm.dep_id IN
#{depId}
ORDER BY
sd.create_time ASC
SELECT
sd.id,
CONCAT( sd.NAME, '(NO', sd.material_no, ')' ) as name,
sd.big_classify_id,
sd.small_classify_id,
sm.dep_id
FROM
safe_material_detail sd
inner join safe_material sm on sd.sm_id = sm.id
WHERE
sd.del_flag = 0
AND sd.ir_status = 1
AND sd.rfid in
#{rfid}