日期和sql优化
This commit is contained in:
@@ -18,16 +18,17 @@
|
||||
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="billNo != null">
|
||||
and ah.bill_no like '%${billNo}%'
|
||||
<bind name="bindBillNo" value="'%'+billNo+'%'"/>
|
||||
and ah.bill_no like #{bindBillNo}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and ah.type='${type}'
|
||||
and ah.type=#{type}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and ah.bill_time >= '${beginTime} 00:00:00'
|
||||
and ah.bill_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and ah.bill_time <= '${endTime} 23:59:59'
|
||||
and ah.bill_time <= #{endTime}
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and ah.creator in (
|
||||
@@ -50,16 +51,17 @@
|
||||
FROM jsh_account_head
|
||||
WHERE 1=1
|
||||
<if test="billNo != null">
|
||||
and bill_no like '%${billNo}%'
|
||||
<bind name="bindBillNo" value="'%'+billNo+'%'"/>
|
||||
and bill_no like #{bindBillNo}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and bill_time >= '${beginTime} 00:00:00'
|
||||
and bill_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and bill_time <= '${endTime} 23:59:59'
|
||||
and bill_time <= #{endTime}
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and creator in (
|
||||
@@ -73,8 +75,8 @@
|
||||
|
||||
<select id="findAllMoney" resultType="java.math.BigDecimal">
|
||||
select sum(${modeName}) as allMoney from jsh_account_head
|
||||
where type='${type}'
|
||||
and organ_id =${supplierId} and bill_time <![CDATA[ <='${endTime}']]>
|
||||
where type=#{type}
|
||||
and organ_id =#{supplierId} and bill_time <= #{endTime}
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -86,7 +88,7 @@
|
||||
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="billNo != null">
|
||||
and ah.bill_no = '${billNo}'
|
||||
and ah.bill_no = #{billNo}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -12,13 +12,15 @@
|
||||
FROM jsh_account_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -31,13 +33,15 @@
|
||||
FROM jsh_account_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -46,7 +50,7 @@
|
||||
select ai.*,a.Name AccountName,ioi.Name InOutItemName
|
||||
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'
|
||||
where ai.header_id = ${headerId}
|
||||
where ai.header_id = #{headerId}
|
||||
and ifnull(ai.delete_flag,'0') !='1'
|
||||
order by ai.id asc
|
||||
</select>
|
||||
|
||||
@@ -35,13 +35,16 @@
|
||||
FROM jsh_account
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
and serial_no like '%${serialNo}%'
|
||||
<if test="serialNo != null and serialNo !=''">
|
||||
<bind name="bindSerialNo" value="'%'+serialNo+'%'"/>
|
||||
and serial_no like #{bindSerialNo}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -55,13 +58,16 @@
|
||||
FROM jsh_account
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
and serial_no like '%${serialNo}%'
|
||||
<if test="serialNo != null and serialNo !=''">
|
||||
<bind name="bindSerialNo" value="'%'+serialNo+'%'"/>
|
||||
and serial_no like #{bindSerialNo}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -72,7 +78,7 @@
|
||||
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and dh.account_id=${accountId}
|
||||
and dh.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
|
||||
@@ -82,7 +88,7 @@
|
||||
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and ah.account_id=${accountId}
|
||||
and ah.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||
@@ -92,7 +98,7 @@
|
||||
inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.type in ('收款','付款','收预付款')
|
||||
<if test="accountId != null">
|
||||
and ai.account_id=${accountId}
|
||||
and ai.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--主表中转出的账户 -->
|
||||
@@ -101,7 +107,7 @@
|
||||
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.type='转账'
|
||||
<if test="accountId != null">
|
||||
and ah.account_id=${accountId}
|
||||
and ah.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中被转入的账户 -->
|
||||
@@ -110,7 +116,7 @@
|
||||
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.type='转账'
|
||||
<if test="accountId != null">
|
||||
and ai.account_id=${accountId}
|
||||
and ai.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--多账户的情况 -->
|
||||
@@ -120,7 +126,8 @@
|
||||
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and dh.account_id_list like '%${accountId}%'
|
||||
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
|
||||
and dh.account_id_list like #{bindAccountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
ORDER BY oTime desc
|
||||
@@ -137,7 +144,7 @@
|
||||
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and dh.account_id=${accountId}
|
||||
and dh.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
<!--主表收入和支出涉及的账户 -->
|
||||
@@ -146,7 +153,7 @@
|
||||
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and ah.account_id=${accountId}
|
||||
and ah.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||
@@ -156,7 +163,7 @@
|
||||
inner join jsh_account_item ai on ai.header_id=ah.Id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.Type in ('收款','付款','收预付款')
|
||||
<if test="accountId != null">
|
||||
and ai.account_id=${accountId}
|
||||
and ai.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--主表中转出的账户 -->
|
||||
@@ -165,7 +172,7 @@
|
||||
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.type='转账'
|
||||
<if test="accountId != null">
|
||||
and ah.account_id=${accountId}
|
||||
and ah.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中被转入的账户 -->
|
||||
@@ -174,7 +181,7 @@
|
||||
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
|
||||
where ah.type='转账'
|
||||
<if test="accountId != null">
|
||||
and ai.account_id=${accountId}
|
||||
and ai.account_id=#{accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--多账户的情况 -->
|
||||
@@ -183,7 +190,8 @@
|
||||
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="accountId != null">
|
||||
and dh.account_id_list like '%${accountId}%'
|
||||
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
|
||||
and dh.account_id_list like #{bindAccountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
) cc
|
||||
|
||||
@@ -52,29 +52,30 @@
|
||||
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type='${subType}'
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and dh.status ='${status}'
|
||||
and dh.status =#{status}
|
||||
</if>
|
||||
<if test="number != null">
|
||||
and dh.number like '%${number}%'
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime} 00:00:00'
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime} 23:59:59'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotIds != null and depotIds !=''">
|
||||
and di.depot_id in (${depotIds})
|
||||
and di.depot_id in (#{depotIds})
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
@@ -97,29 +98,30 @@
|
||||
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type='${subType}'
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and dh.status ='${status}'
|
||||
and dh.status =#{status}
|
||||
</if>
|
||||
<if test="number != null">
|
||||
and dh.number like '%${number}%'
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime} 00:00:00'
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime} 23:59:59'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotIds != null and depotIds !=''">
|
||||
and di.depot_id in (${depotIds})
|
||||
and di.depot_id in (#{depotIds})
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
@@ -135,7 +137,7 @@
|
||||
select group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',ifnull(jsh_material.model,''))) as mName
|
||||
from jsh_depot_item
|
||||
inner join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
where jsh_depot_item.header_id = ${id}
|
||||
where jsh_depot_item.header_id = #{id}
|
||||
and ifnull(jsh_depot_item.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -147,15 +149,15 @@
|
||||
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
|
||||
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
|
||||
where dh.oper_time >='${beginTime} 00:00:00' and dh.oper_time <='${endTime} 23:59:59'
|
||||
where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
and dh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
and di.depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
@@ -175,15 +177,15 @@
|
||||
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1'
|
||||
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
|
||||
where dh.oper_time >='${beginTime} 00:00:00' and dh.oper_time <='${endTime} 23:59:59'
|
||||
where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
and dh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
and di.depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
@@ -198,24 +200,24 @@
|
||||
(select sum(jdi.basic_number) numSum from jsh_depot_head jdh
|
||||
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
|
||||
where jdi.material_id=di.material_id
|
||||
and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time <='${endTime}'
|
||||
and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and jdh.organ_id = ${oId}
|
||||
and jdh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and jdi.depot_id = ${depotId}
|
||||
and jdi.depot_id = #{depotId}
|
||||
</if>
|
||||
and ifnull(jdh.delete_flag,'0') !='1'
|
||||
) numSum,
|
||||
(select sum(jdi.all_price) priceSum from jsh_depot_head jdh
|
||||
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
|
||||
where jdi.material_id=di.material_id
|
||||
and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time <='${endTime}'
|
||||
and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and jdh.organ_id = ${oId}
|
||||
and jdh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and jdi.depot_id = ${depotId}
|
||||
and jdi.depot_id = #{depotId}
|
||||
</if>
|
||||
and ifnull(jdh.delete_flag,'0') !='1'
|
||||
) priceSum
|
||||
@@ -226,12 +228,12 @@
|
||||
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m
|
||||
on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
on m.Id=di.material_id where dh.type=#{type} and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
and dh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
and di.depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
@@ -252,12 +254,12 @@
|
||||
from jsh_material
|
||||
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
) m on m.Id=di.material_id where dh.type=#{type} and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
and dh.organ_id = #{oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
and di.depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
@@ -271,20 +273,20 @@
|
||||
select dh.number,concat(dh.sub_type,dh.type) as type,dh.discount_last_money,dh.other_money,dh.change_amount,s.supplier supplierName,
|
||||
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depot_head dh
|
||||
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
|
||||
and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
where s.type=#{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
|
||||
and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and dh.organ_id=${organId}
|
||||
and dh.organ_id=#{organId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
UNION ALL
|
||||
select ah.bill_no number,ah.type as newType,ah.total_price discount_last_money, 0 other_money,ah.change_amount,s.supplier supplierName,
|
||||
date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_account_head ah
|
||||
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type='${supType}'
|
||||
and ah.bill_time >='${beginTime}' and ah.bill_time <='${endTime}'
|
||||
where s.type=#{supType}
|
||||
and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=${organId}
|
||||
and ah.organ_id=#{organId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
ORDER BY oTime
|
||||
@@ -298,33 +300,33 @@
|
||||
(
|
||||
select count(1) a from jsh_depot_head dh
|
||||
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
|
||||
and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
where s.type=#{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
|
||||
and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and dh.organ_id=${organId}
|
||||
and dh.organ_id=#{organId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
UNION ALL
|
||||
select count(1) a from jsh_account_head ah
|
||||
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type='${supType}'
|
||||
and ah.bill_time >='${beginTime}' and ah.bill_time <='${endTime}'
|
||||
where s.type=#{supType}
|
||||
and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=${organId}
|
||||
and ah.organ_id=#{organId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
) cc
|
||||
</select>
|
||||
|
||||
<select id="findAllMoney" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(${modeName}),0) as allMoney from jsh_depot_head where type='${type}' and sub_type = '${subType}'
|
||||
and organ_id =${supplierId} and oper_time <='${endTime}'
|
||||
select ifnull(sum(${modeName}),0) as allMoney from jsh_depot_head where type=#{type} and sub_type = #{subType}
|
||||
and organ_id =#{supplierId} and oper_time <=#{endTime}
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAllOtherMoney" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(other_money),0) as allOtherMoney from jsh_depot_head where type='${type}' and sub_type = '${subType}'
|
||||
and organ_id =${supplierId} and oper_time <='${endTime}'
|
||||
select ifnull(sum(other_money),0) as allOtherMoney from jsh_depot_head where type=#{type} and sub_type = #{subType}
|
||||
and organ_id =#{supplierId} and oper_time <=#{endTime}
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -335,7 +337,7 @@
|
||||
left join jsh_account a on dh.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="number != null">
|
||||
and dh.number='${number}'
|
||||
and dh.number=#{number}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -393,10 +395,10 @@
|
||||
FROM jsh_depot_head
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and sub_type='${subType}'
|
||||
and sub_type=#{subType}
|
||||
</if>
|
||||
<if test="hasSupplier == 1">
|
||||
and organ_id is not null
|
||||
@@ -405,10 +407,10 @@
|
||||
and organ_id is null
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and oper_time >= '${beginTime}'
|
||||
and oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and oper_time <= '${endTime}'
|
||||
and oper_time <= #{endTime}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -419,10 +421,10 @@
|
||||
FROM jsh_depot_head
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and sub_type='${subType}'
|
||||
and sub_type=#{subType}
|
||||
</if>
|
||||
<if test="hasSupplier == 1">
|
||||
and organ_id is not null
|
||||
@@ -431,10 +433,10 @@
|
||||
and organ_id is null
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and oper_time >= '${beginTime}'
|
||||
and oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and oper_time <= '${endTime}'
|
||||
and oper_time <= #{endTime}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -76,13 +76,15 @@
|
||||
FROM jsh_depot_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -96,13 +98,15 @@
|
||||
FROM jsh_depot_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -128,7 +132,7 @@
|
||||
or (dh.type='其它' and dh.sub_type='组装单')
|
||||
or (dh.type='其它' and dh.sub_type='拆卸单')
|
||||
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
|
||||
and di.material_id =${mId}
|
||||
and di.material_id = #{mId}
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
ORDER BY oTime desc
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -144,7 +148,7 @@
|
||||
or (dh.type='其它' and dh.sub_type='组装单')
|
||||
or (dh.type='其它' and dh.sub_type='拆卸单')
|
||||
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
|
||||
and di.material_id =${mId}
|
||||
and di.material_id =#{mId}
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -158,7 +162,7 @@
|
||||
left join jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
left join jsh_depot dp1 on di.depot_id=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
|
||||
left join jsh_depot dp2 on di.another_depot_id=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
|
||||
where di.header_id = ${headerId}
|
||||
where di.header_id = #{headerId}
|
||||
and ifnull(di.delete_flag,'0') !='1'
|
||||
order by di.id asc
|
||||
</select>
|
||||
@@ -180,7 +184,7 @@
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name
|
||||
@@ -201,7 +205,7 @@
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
and ifnull(di.delete_flag,'0') !='1'
|
||||
group by m.id) cc
|
||||
@@ -210,8 +214,8 @@
|
||||
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(basic_number),0) as BasicNumber from jsh_depot_item di,jsh_depot_head dh
|
||||
where di.header_id = dh.id
|
||||
and dh.type='${type}' and dh.sub_type='${subType}'
|
||||
and di.material_id =${MId}
|
||||
and dh.type=#{type} and dh.sub_type=#{subType}
|
||||
and di.material_id =#{MId}
|
||||
and dh.oper_time >= #{beginTime}
|
||||
and dh.oper_time <= #{endTime}
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
@@ -221,8 +225,8 @@
|
||||
<select id="buyOrSalePrice" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh
|
||||
where di.header_id = dh.id
|
||||
and dh.type='${type}' and dh.sub_type='${subType}'
|
||||
and di.material_id =${MId}
|
||||
and dh.type=#{type} and dh.sub_type=#{subType}
|
||||
and di.material_id =#{MId}
|
||||
and dh.oper_time >= #{beginTime}
|
||||
and dh.oper_time <= #{endTime}
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
@@ -232,7 +236,7 @@
|
||||
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(discount_last_money),0) as allMoney from jsh_depot_head dh
|
||||
where 1=1
|
||||
and dh.type='${type}' and dh.sub_type='${subType}'
|
||||
and dh.type=#{type} and dh.sub_type=#{subType}
|
||||
and dh.oper_time >= #{beginTime}
|
||||
and dh.oper_time <= #{endTime}
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
@@ -250,10 +254,10 @@
|
||||
and di.depot_id=#{depotId}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime}'
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
and ifnull(di.delete_flag,'0') !='1'
|
||||
@@ -277,10 +281,10 @@
|
||||
and dh.id=di.header_id
|
||||
and di.material_id=#{mId}
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime}'
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
and dh.oper_time <= #{endTime}
|
||||
</if>
|
||||
and dh.tenant_id=#{tenantId}
|
||||
and di.tenant_id=#{tenantId}
|
||||
@@ -386,7 +390,7 @@
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and mcs.depot_id= ${depotId}
|
||||
and mcs.depot_id= #{depotId}
|
||||
</if>
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name
|
||||
order by linjieNumber desc
|
||||
@@ -411,7 +415,7 @@
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and mcs.depot_id= ${depotId}
|
||||
and mcs.depot_id= #{depotId}
|
||||
</if>
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name) tb
|
||||
</select>
|
||||
|
||||
@@ -11,13 +11,15 @@
|
||||
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and dep.name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and dep.name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dep.type=${type}
|
||||
and dep.type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and dep.remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and dep.remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(dep.delete_Flag,'0') !='1'
|
||||
order by dep.sort asc
|
||||
@@ -32,13 +34,15 @@
|
||||
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and dep.name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and dep.name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dep.type=${type}
|
||||
and dep.type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and dep.remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and dep.remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(dep.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
FROM jsh_function
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by sort asc
|
||||
@@ -23,10 +24,11 @@
|
||||
FROM jsh_function
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
FROM jsh_in_out_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -25,13 +27,15 @@
|
||||
FROM jsh_in_out_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and remark like #{bindRemark}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -11,25 +11,28 @@
|
||||
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
|
||||
where 1=1
|
||||
<if test="operation != null">
|
||||
and l.operation like '%${operation}%'
|
||||
<bind name="bindOperation" value="'%'+operation+'%'"/>
|
||||
and l.operation like #{bindOperation}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and l.user_id=${userId}
|
||||
and l.user_id=#{userId}
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
and l.client_ip like '%${clientIp}%'
|
||||
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>
|
||||
and l.client_ip like #{bindClientIp}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and l.status=${status}
|
||||
and l.status=#{status}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and l.create_time >= '${beginTime}'
|
||||
and l.create_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and l.create_time <= '${endTime}'
|
||||
and l.create_time <= #{endTime}
|
||||
</if>
|
||||
<if test="content != null">
|
||||
and l.content like '%${content}%'
|
||||
<bind name="bindContent" value="'%'+content+'%'"/>
|
||||
and l.content like #{bindContent}
|
||||
</if>
|
||||
order by l.create_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -43,25 +46,28 @@
|
||||
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
|
||||
WHERE 1=1
|
||||
<if test="operation != null">
|
||||
and l.operation like '%${operation}%'
|
||||
<bind name="bindOperation" value="'%'+operation+'%'"/>
|
||||
and l.operation like #{bindOperation}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and l.user_id=${userId}
|
||||
and l.user_id=#{userId}
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
and l.client_ip like '%${clientIp}%'
|
||||
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>
|
||||
and l.client_ip like #{bindClientIp}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and l.status = ${status}
|
||||
and l.status = #{status}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and l.create_time >= '${beginTime}'
|
||||
and l.create_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and l.create_time <= '${endTime}'
|
||||
and l.create_time <= #{endTime}
|
||||
</if>
|
||||
<if test="content != null">
|
||||
and l.content like '%${content}%'
|
||||
<bind name="bindContent" value="'%'+content+'%'"/>
|
||||
and l.content like #{bindContent}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -7,10 +7,11 @@
|
||||
where 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = ${parentId}
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
and Id !=1
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -24,10 +25,11 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = ${parentId}
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
and Id !=1
|
||||
</select>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="ResultMapList">
|
||||
select DISTINCT d.Id,d.bar_code,d.commodity_unit,d.commodity_decimal,d.purchase_decimal,d.wholesale_decimal,d.low_decimal
|
||||
from jsh_material_extend d
|
||||
where d.material_id = '${materialId}'
|
||||
where d.material_id = #{materialId}
|
||||
and ifnull(d.delete_Flag,'0') !='1'
|
||||
order by d.default_flag desc,d.id asc
|
||||
</select>
|
||||
@@ -19,7 +19,7 @@
|
||||
select update_time from jsh_material_extend
|
||||
where 1=1
|
||||
<if test="lastTime != null">
|
||||
and update_time > ${lastTime}
|
||||
and update_time > #{lastTime}
|
||||
</if>
|
||||
order by update_time asc
|
||||
<if test="syncNum != null">
|
||||
|
||||
@@ -26,16 +26,20 @@
|
||||
where 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
<bind name="bindBarCode" value="'%'+barCode+'%'"/>
|
||||
and me.bar_code like #{bindBarCode}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and m.name like #{bindName}
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
<bind name="bindStandard" value="'%'+standard+'%'"/>
|
||||
and m.standard like #{bindStandard}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<bind name="bindModel" value="'%'+model+'%'"/>
|
||||
and m.model like #{bindModel}
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
@@ -60,16 +64,20 @@
|
||||
WHERE 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
<bind name="bindBarCode" value="'%'+barCode+'%'"/>
|
||||
and me.bar_code like #{bindBarCode}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and m.name like #{bindName}
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
<bind name="bindStandard" value="'%'+standard+'%'"/>
|
||||
and m.standard like #{bindStandard}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<bind name="bindModel" value="'%'+model+'%'"/>
|
||||
and m.model like #{bindModel}
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
@@ -83,14 +91,14 @@
|
||||
<select id="findUnitList" resultType="com.jsh.erp.datasource.entities.Unit">
|
||||
select u.* from jsh_unit u
|
||||
left join jsh_material m on m.unit_id=u.id and ifnull(m.delete_flag,'0') !='1'
|
||||
where m.id = ${mId}
|
||||
where m.id = #{mId}
|
||||
and ifnull(u.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
|
||||
select m.*,u.name unit_name from jsh_material m
|
||||
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_flag,'0') !='1'
|
||||
where m.id = ${id}
|
||||
where m.id = #{id}
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -100,7 +108,7 @@
|
||||
from jsh_material m
|
||||
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where me.id = ${meId}
|
||||
where me.id = #{meId}
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -133,7 +141,8 @@
|
||||
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where m.enabled=1 and me.id is not null
|
||||
<if test="q != null">
|
||||
and (m.name like '%${q}%' or me.bar_code like '%${q}%')
|
||||
<bind name="bindKey" value="'%'+q+'%'"/>
|
||||
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
@@ -154,16 +163,20 @@
|
||||
where 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
<bind name="bindBarCode" value="'%'+barCode+'%'"/>
|
||||
and me.bar_code like #{bindBarCode}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and m.name like #{bindName}
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
<bind name="bindStandard" value="'%'+standard+'%'"/>
|
||||
and m.standard like #{bindStandard}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<bind name="bindModel" value="'%'+standard+'%'"/>
|
||||
and m.model like #{bindModel}
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
@@ -264,7 +277,7 @@
|
||||
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="meId != null">
|
||||
and me.id = ${meId}
|
||||
and me.id = #{meId}
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
FROM jsh_material_property
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and native_name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and native_name like #{bindName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -19,7 +20,8 @@
|
||||
FROM jsh_material_property
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and native_name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and native_name like #{bindName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and msg_title like #{bindName}
|
||||
</if>
|
||||
order by create_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -21,7 +22,8 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and msg_title like #{bindName}
|
||||
</if>
|
||||
</select>
|
||||
<update id="batchDeleteMsgByIds">
|
||||
@@ -54,7 +56,7 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="msgTitle != null">
|
||||
and msg_title = '${msgTitle}'
|
||||
and msg_title = #{msgTitle}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -65,7 +67,7 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="status != null">
|
||||
and status = '${status}'
|
||||
and status = #{status}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -6,10 +6,11 @@
|
||||
FROM jsh_person
|
||||
where 1=1
|
||||
<if test="name != null and name != ''">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -22,10 +23,11 @@
|
||||
FROM jsh_person
|
||||
WHERE 1=1
|
||||
<if test="name != null and name != ''">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
@@ -20,7 +21,8 @@
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
</select>
|
||||
<update id="batchDeleteRoleByIds">
|
||||
|
||||
@@ -6,16 +6,19 @@
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
<bind name="bindSupplier" value="'%'+supplier+'%'"/>
|
||||
and supplier like #{bindSupplier}
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
<bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
|
||||
and phone_num like #{bindPhoneNum}
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
<bind name="bindTelephone" value="'%'+telephone+'%'"/>
|
||||
and telephone like #{bindTelephone}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by id desc
|
||||
@@ -29,16 +32,19 @@
|
||||
FROM jsh_supplier
|
||||
WHERE 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
<bind name="bindSupplier" value="'%'+supplier+'%'"/>
|
||||
and supplier like #{bindSupplier}
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
<bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
|
||||
and phone_num like #{bindPhoneNum}
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
<bind name="bindTelephone" value="'%'+telephone+'%'"/>
|
||||
and telephone like #{bindTelephone}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
@@ -48,16 +54,19 @@
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
<bind name="bindSupplier" value="'%'+supplier+'%'"/>
|
||||
and supplier like #{bindSupplier}
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
and type=#{type}
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
<bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
|
||||
and phone_num like #{bindPhoneNum}
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
<bind name="bindTelephone" value="'%'+telephone+'%'"/>
|
||||
and telephone like #{bindTelephone}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by id desc
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
FROM jsh_system_config
|
||||
where 1=1
|
||||
<if test="companyName != null">
|
||||
and company_name like '%${companyName}%'
|
||||
<bind name="bindCompanyName" value="'%'+companyName+'%'"/>
|
||||
and company_name like #{bindCompanyName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -19,7 +20,8 @@
|
||||
FROM jsh_system_config
|
||||
WHERE 1=1
|
||||
<if test="companyName != null">
|
||||
and company_name like '%${companyName}%'
|
||||
<bind name="bindCompanyName" value="'%'+companyName+'%'"/>
|
||||
and company_name like #{bindCompanyName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
FROM jsh_tenant
|
||||
where 1=1
|
||||
<if test="loginName != null">
|
||||
and login_name like '%${loginName}%'
|
||||
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
|
||||
and login_name like #{bindLoginName}
|
||||
</if>
|
||||
order by id desc
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -23,7 +24,8 @@
|
||||
FROM jsh_tenant
|
||||
WHERE 1=1
|
||||
<if test="loginName != null">
|
||||
and login_name like '%${loginName}%'
|
||||
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
|
||||
and login_name like #{bindLoginName}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -6,7 +6,8 @@
|
||||
FROM jsh_unit
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -19,7 +20,8 @@
|
||||
FROM jsh_unit
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
where 1=1
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
<if test="userName != null">
|
||||
and user.username like '%${userName}%'
|
||||
<bind name="bindUserName" value="'%'+userName+'%'"/>
|
||||
and user.username like #{bindUserName}
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
and user.login_name like '%${loginName}%'
|
||||
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
|
||||
and user.login_name like #{bindLoginName}
|
||||
</if>
|
||||
order by rel.user_blng_orga_dspl_seq,user.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
@@ -41,10 +43,12 @@
|
||||
where 1=1
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
<if test="userName != null">
|
||||
and user.username like '%${userName}%'
|
||||
<bind name="bindUserName" value="'%'+userName+'%'"/>
|
||||
and user.username like #{bindUserName}
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
and user.login_name like '%${loginName}%'
|
||||
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
|
||||
and user.login_name like #{bindLoginName}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getUserListByUserNameOrLoginName" resultMap="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap">
|
||||
|
||||
Reference in New Issue
Block a user