机具库存收藏修改
This commit is contained in:
parent
bc847087d8
commit
037c8e3e69
|
|
@ -97,51 +97,57 @@
|
|||
</select>
|
||||
|
||||
<select id="findGpsFlowPage" parameterType="com.bonus.ma.beans.GpsBindingBean" resultMap="gisBean">
|
||||
select DISTINCT
|
||||
mam.ID,matt.ID as tyoeId0,matt.`NAME` as typeName,mat.ID as tyoeId,mat.`NAME` as type,
|
||||
mam.OUT_FAC_TIME as outFactortTime,mam.DEVICE_CODE as deviceCode,mam.OUT_FAC_NUM as outFactortNum,ROUND(mat.BUY_PRICE) as buyPrice,mam.PIC_URL as picUrl,
|
||||
mam.IS_FIXED_ASSETS as isFixedAssets,mat.LEASE_PRICE as leasePrice,ROUND(mat.PAY_PRICE) as payPrice, mam.ASSETS_NUM as assetNum,mam.CYCLE_NUM as outInNum,
|
||||
mam.REMARK as remarks,mam.PROPERTY_DEPARTMENT as propertyDepartment,mam.USE_DEPARTMENT as useDepartment,mam.SERVICE_LIFE as serviceLife,
|
||||
mam.BATCH_STATUS as batchStatus,mam.GPS_CODE as gpsCode,mam.MAKE_ORDER_DATE as makeOrderDate,mam.INVOICE_DATE as invoiceDate,mam.QRCODE as qrcode,mam.DEVICE_TYPE as deviceType
|
||||
,org.NAME companyName,mam.ORIGIN_NUM originNum,rel.ORG_ID orgId ,mam.GPS_CODE ,flow.OPERTER_TIME optTime,flow.OPERTER,user.`NAME` ,user.LOGIN_NAME userName
|
||||
,flow.GIS_CODE gisCode,flow.type gisType
|
||||
from ma_gis_code_flow flow
|
||||
LEFT JOIN mm_machines mam on flow.MA_ID=mam.id
|
||||
LEFT JOIN ma_status mas on mam.BATCH_STATUS = mas.BATCH_STATUS
|
||||
left join pm_user user on user.id=flow.OPERTER
|
||||
LEFT JOIN mm_type mat on mam.TYPE = mat.ID
|
||||
LEFT JOIN mm_type matt on matt.ID = mat.PARENT_ID
|
||||
LEFT JOIN ma_org_relation rel on rel.TYPE_ID=mat.ID
|
||||
LEFT JOIN pm_organization org on org.ID=rel.ORG_ID
|
||||
where 1=1 and mam.id is not null
|
||||
<if test='param.orgId !=null and param.orgId!="" and param.orgId !="1" '>
|
||||
and rel.ORG_ID=#{param.orgId}
|
||||
</if>
|
||||
<if test="param.batchStatus != 0">
|
||||
and mas.MA_STATUS = #{param.batchStatus}
|
||||
</if>
|
||||
<if test="param.deviceType != 0">
|
||||
and mam.DEVICE_TYPE = #{param.deviceType}
|
||||
</if>
|
||||
<if test="param.typeName != null and param.typeName != ''">
|
||||
and matt.`NAME` = #{param.typeName}
|
||||
</if>
|
||||
<if test="param.type != null and param.type != ''">
|
||||
and mat.`NAME` = #{param.type}
|
||||
</if>
|
||||
<if test="param.keyWord !=null and param.keyWord !=''">
|
||||
and (
|
||||
matt.`NAME` LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.DEVICE_CODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mat.`NAME` LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.QRCODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.BATCH_STATUS LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
flow.GIS_CODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
user.LOGIN_NAME LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
select DISTINCT
|
||||
mam.ID,matt.ID as tyoeId0,matt.`NAME` as typeName,mat.ID as tyoeId,mat.`NAME` as type,
|
||||
mam.OUT_FAC_TIME as outFactortTime,mam.DEVICE_CODE as deviceCode,mam.OUT_FAC_NUM as
|
||||
outFactortNum,ROUND(mat.BUY_PRICE) as buyPrice,mam.PIC_URL as picUrl,
|
||||
mam.IS_FIXED_ASSETS as isFixedAssets,mat.LEASE_PRICE as leasePrice,ROUND(mat.PAY_PRICE) as payPrice,
|
||||
mam.ASSETS_NUM as assetNum,mam.CYCLE_NUM as outInNum,
|
||||
mam.REMARK as remarks,mam.PROPERTY_DEPARTMENT as propertyDepartment,mam.USE_DEPARTMENT as
|
||||
useDepartment,mam.SERVICE_LIFE as serviceLife,
|
||||
mam.BATCH_STATUS as batchStatus,mam.GPS_CODE as gpsCode,mam.MAKE_ORDER_DATE as makeOrderDate,mam.INVOICE_DATE as
|
||||
invoiceDate,mam.QRCODE as qrcode,mam.DEVICE_TYPE as deviceType
|
||||
,org.NAME companyName,mam.ORIGIN_NUM originNum,rel.ORG_ID orgId ,mam.GPS_CODE ,flow.OPERTER_TIME
|
||||
optTime,flow.OPERTER,user.`NAME` ,user.LOGIN_NAME userName
|
||||
,flow.GIS_CODE gisCode,flow.type gisType
|
||||
from ma_gis_code_flow flow
|
||||
LEFT JOIN mm_machines mam on flow.MA_ID=mam.id
|
||||
LEFT JOIN ma_status mas on mam.BATCH_STATUS = mas.BATCH_STATUS
|
||||
left join pm_user user on user.id=flow.OPERTER
|
||||
LEFT JOIN mm_type mat on mam.TYPE = mat.ID
|
||||
LEFT JOIN mm_type matt on matt.ID = mat.PARENT_ID
|
||||
LEFT JOIN ma_org_relation rel on rel.TYPE_ID=mat.ID
|
||||
LEFT JOIN pm_organization org on org.ID=rel.ORG_ID
|
||||
where 1=1 and mam.id is not null
|
||||
<if test='param.orgId !=null and param.orgId!="" and param.orgId !="1" '>
|
||||
and rel.ORG_ID=#{param.orgId}
|
||||
</if>
|
||||
<if test="param.batchStatus != 0">
|
||||
and mas.MA_STATUS = #{param.batchStatus}
|
||||
</if>
|
||||
<if test="param.deviceType != 0">
|
||||
and mam.DEVICE_TYPE = #{param.deviceType}
|
||||
</if>
|
||||
<if test="param.typeName != null and param.typeName != ''">
|
||||
and matt.`NAME` LIKE CONCAT('%', #{param.typeName},'%')
|
||||
</if>
|
||||
<if test="param.type != null and param.type != ''">
|
||||
and mat.`NAME` LIKE CONCAT('%',#{param.type},'%')
|
||||
</if>
|
||||
<if test="param.keyWord !=null and param.keyWord !=''">
|
||||
and (
|
||||
matt.`NAME` LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.DEVICE_CODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mat.`NAME` LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.QRCODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
mam.BATCH_STATUS LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
flow.GIS_CODE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
user.LOGIN_NAME LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
org.NAME LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getGisCodeBylist" parameterType="com.bonus.ma.beans.GpsBindingBean" resultMap="gisBean">
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
wsa.`CODE` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR wsa.CREATOR LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR wsa.APPLY_REMARK LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR pu.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR mt2.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY wsa.id
|
||||
|
|
|
|||
|
|
@ -30,41 +30,45 @@
|
|||
|
||||
<select id="findByPage" resultMap="scrap" parameterType="com.bonus.scrap.beans.ScrapAuditBean">
|
||||
|
||||
SELECT
|
||||
wsa.ID,
|
||||
wsa.`CODE`,
|
||||
wsa.CREATE_TIME AS applyTime,
|
||||
wsa.apply_remark AS applyRemark,
|
||||
SELECT
|
||||
wsa.ID,
|
||||
wsa.`CODE`,
|
||||
wsa.CREATE_TIME AS applyTime,
|
||||
wsa.apply_remark AS applyRemark,
|
||||
|
||||
pu.`NAME` AS applyer,
|
||||
pu2.`NAME` AS auditor,
|
||||
wsa.AUDIT_TIME AS auditTime,
|
||||
wsa.AUDIT_REMARK AS auditRemark ,
|
||||
wsa.`STATUS`,
|
||||
GROUP_CONCAT(DISTINCT mt2.`NAME`) as typeName
|
||||
pu.`NAME` AS applyer,
|
||||
pu2.`NAME` AS auditor,
|
||||
wsa.AUDIT_TIME AS auditTime,
|
||||
wsa.AUDIT_REMARK AS auditRemark ,
|
||||
wsa.`STATUS`,
|
||||
GROUP_CONCAT(DISTINCT mt2.`NAME`) as typeName
|
||||
|
||||
FROM
|
||||
wf_scrap_apply wsa
|
||||
LEFT JOIN scrap_apply_details sad ON sad.apply_id = wsa.ID
|
||||
LEFT JOIN mm_type mt ON mt.ID = sad.type_id
|
||||
LEFT JOIN mm_type mt2 ON mt2.ID = mt.PARENT_ID
|
||||
LEFT JOIN pm_user pu on wsa.CREATOR = pu.ID
|
||||
LEFT JOIN pm_user pu2 on wsa.AUDITOR = pu2.ID
|
||||
where wsa.`STATUS` in (0,1,2)
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND wsa.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.keyWord != null and param.keyWord != ''">
|
||||
AND (
|
||||
wsa.`CODE` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
or pu.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
or pu2.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
FROM
|
||||
wf_scrap_apply wsa
|
||||
LEFT JOIN scrap_apply_details sad ON sad.apply_id = wsa.ID
|
||||
LEFT JOIN mm_type mt ON mt.ID = sad.type_id
|
||||
LEFT JOIN mm_type mt2 ON mt2.ID = mt.PARENT_ID
|
||||
LEFT JOIN pm_user pu on wsa.CREATOR = pu.ID
|
||||
LEFT JOIN pm_user pu2 on wsa.AUDITOR = pu2.ID
|
||||
where wsa.`STATUS` in (0,1,2)
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND wsa.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.keyWord != null and param.keyWord != ''">
|
||||
AND (
|
||||
wsa.`CODE` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
or pu.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
or pu2.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR wsa.CREATOR LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR wsa.APPLY_REMARK LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR pu.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR mt2.`NAME` LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
|
||||
)
|
||||
</if>
|
||||
GROUP BY wsa.ID
|
||||
order by wsa.ID desc
|
||||
</select>
|
||||
)
|
||||
</if>
|
||||
GROUP BY wsa.ID
|
||||
order by wsa.ID desc
|
||||
</select>
|
||||
|
||||
<select id="findScrapApplyById" resultMap="baseResultMap" parameterType="com.bonus.scrap.beans.ScrapAuditBean">
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
OR mam.ASSETS_NUM LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR mam.DEVICE_CODE LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR mam.REMARK LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
OR sup2.NUMBER LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<!-- union
|
||||
|
|
|
|||
Loading…
Reference in New Issue