select *
FROM jsh_account_item
where 1=1
and name like #{bindName}
and type=#{type}
and remark like #{bindRemark}
and ifnull(delete_flag,'0') !='1'
limit #{offset},#{rows}
SELECT
COUNT(id)
FROM jsh_account_item
WHERE 1=1
and name like #{bindName}
and type=#{type}
and remark like #{bindRemark}
and ifnull(delete_flag,'0') !='1'
select ai.*,a.Name AccountName,ioi.Name InOutItemName, dh.number billNumber
from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
left join jsh_depot_head dh on ai.bill_id = dh.id and ifnull(dh.delete_Flag,'0') !='1'
where ai.header_id = #{headerId}
and ifnull(ai.delete_flag,'0') !='1'
order by ai.id asc
update jsh_account_item
set delete_flag='1'
where 1=1
and id in (
#{id}
)
select
from jsh_account_item
where 1=1
and account_id in (
#{accountId}
)
and ifnull(delete_flag,'0') !='1'
select
from jsh_account_item
where 1=1
and in_out_item_id in (
#{inOutItemId}
)
and ifnull(delete_flag,'0') !='1'
update jsh_account_item
set delete_flag='1'
where 1=1
and header_id in (
#{id}
)
select
ifnull(sum(each_amount),0)
from jsh_account_item
where 1=1
and bill_id=#{billId}
and ifnull(delete_flag,'0') !='1'
select ifnull(sum(ai.each_amount),0) from jsh_account_head ah
left join jsh_account_item ai on ah.id = ai.header_id and ifnull(ai.delete_flag,'0') !='1'
where ah.organ_id = #{organId}
and (ah.type = '收款' or ah.type = '付款')
and ai.bill_id is null
and ifnull(ah.delete_flag,'0') !='1'