账户信息sql$修改为#

This commit is contained in:
qiankunpingtai
2019-05-14 15:38:25 +08:00
parent 40a6091cf1
commit 1283b228a9

View File

@@ -19,14 +19,17 @@
select * select *
FROM jsh_account FROM jsh_account
where 1=1 where 1=1
<if test="name != null"> <if test="name != null and name != ''">
and name like '%${name}%' <bind name="name" value="'%' + _parameter.name + '%'"/>
and name like #{name}
</if> </if>
<if test="serialNo != null"> <if test="serialNo != null and serialNo != ''">
and SerialNo like '%${serialNo}%' <bind name="serialNo" value="'%' + _parameter.serialNo + '%'"/>
and SerialNo like #{serialNo}
</if> </if>
<if test="remark != null"> <if test="remark != null and remark != ''">
and remark like '%${remark}%' <bind name="remark" value="'%' + _parameter.remark + '%'"/>
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
@@ -39,14 +42,17 @@
COUNT(id) COUNT(id)
FROM jsh_account FROM jsh_account
WHERE 1=1 WHERE 1=1
<if test="name != null"> <if test="name != null and name != ''">
and name like '%${name}%' <bind name="name" value="'%' + _parameter.name + '%'"/>
and name like #{name}
</if> </if>
<if test="serialNo != null"> <if test="serialNo != null and serialNo != ''">
and SerialNo like '%${serialNo}%' <bind name="serialNo" value="'%' + _parameter.serialNo + '%'"/>
and SerialNo like #{serialNo}
</if> </if>
<if test="remark != null"> <if test="remark != null and remark != ''">
and remark like '%${remark}%' <bind name="remark" value="'%' + _parameter.remark + '%'"/>
and remark like #{remark}
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_Flag,'0') !='1'
</select> </select>
@@ -57,7 +63,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=${accountId} and dh.AccountId=#{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
@@ -67,7 +73,7 @@
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
@@ -77,7 +83,7 @@
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
@@ -86,7 +92,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
@@ -95,7 +101,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
@@ -104,8 +110,13 @@
dh.AccountIdList as AList,dh.AccountMoneyList as AMList dh.AccountIdList as AList,dh.AccountMoneyList as AMList
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null and remark != ''">
<bind name="remark" value="'%' + _parameter.remark + '%'"/>
and remark like #{remark}
</if>
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountIdList like '%${accountId}%' <bind name="accountId" value="'%' + _parameter.accountId + '%'"/>
and dh.AccountIdList like #{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY oTime desc ORDER BY oTime desc
@@ -122,7 +133,7 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountId=${accountId} and dh.AccountId=#{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
<!--主表收入和支出涉及的账户 --> <!--主表收入和支出涉及的账户 -->
@@ -131,7 +142,7 @@
from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) --> <!--明细中涉及的账户(收款,付款,收预付款) -->
@@ -141,7 +152,7 @@
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款') where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--主表中转出的账户 --> <!--主表中转出的账户 -->
@@ -150,7 +161,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ah.AccountId=${accountId} and ah.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--明细中被转入的账户 --> <!--明细中被转入的账户 -->
@@ -159,7 +170,7 @@
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1' from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账' where ah.Type='转账'
<if test="accountId != null"> <if test="accountId != null">
and ai.AccountId=${accountId} and ai.AccountId=#{accountId}
</if> </if>
and ifnull(ah.delete_Flag,'0') !='1' and ifnull(ah.delete_Flag,'0') !='1'
<!--多账户的情况 --> <!--多账户的情况 -->
@@ -168,7 +179,8 @@
from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1' from jsh_depothead dh inner join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="accountId != null"> <if test="accountId != null">
and dh.AccountIdList like '%${accountId}%' <bind name="accountId" value="'%' + _parameter.accountId + '%'"/>
and dh.AccountIdList like #{accountId}
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
) cc ) cc