select machId, machType, machName, machNo, machBrand, machSpec, machBuydate, machUsestatus, machOwnername, machOwnermobile from FmsMach
machSystype = '0'
and machType = #{machType}
and machName like concat('%', #{machName}, '%')
and machBrand like concat('%', #{machBrand}, '%')
and machUsestatus = #{machUsestatus}
and tid = #{tid}
ORDER BY machId DESC
where machId = #{machId} and machSystype = '0'
and tid = #{tid}
where machNo = #{machNo} and machSystype = '0'
and tid = #{tid}
SELECT ma.machName, ma.machType, p.planNo, t.taskId, t.taskNo, c.cropName, c.cropType, c.cropMaintype, m.taskmachUsedcount,
ma.machNo, ma.machSpec, tc.taskrcdId, tc.taskrcdCompletedate, t.taskManager, u.userName AS taskManagername,
t.taskType
FROM FmsTaskmachine AS m
JOIN FmsTaskrcd AS tc ON m.taskrcdId = tc.taskrcdId AND tc.taskrcdAuditstatus = #{taskrcdAuditstatus}
JOIN FmsTask AS t ON tc.taskId = t.taskId
JOIN FmsCrop AS c ON t.cropId = c.cropId
JOIN FmsMach AS ma ON m.machId = ma.machId
JOIN SysUser AS u ON t.taskManager = u.userId
JOIN FmsPlan AS p ON p.planId = t.planId
machSystype = '0'
and machType = #{machType}
and t.blockId = #{blockId}
and machName like concat('%', #{machName}, '%')
and p.planNo like concat('%', #{planNo}, '%')
and t.taskNo like concat('%', #{taskNo}, '%')
and c.cropName like concat('%', #{cropName}, '%')
and u.userName like concat('%', #{taskManagername}, '%')
and tc.taskrcdCompletedate >= #{startDate}
and tc.taskrcdCompletedate #{endDate}
AND t.blockId in
#{item}
and m.tid = #{tid}
ORDER BY tc.taskrcdCompletedate DESC
SELECT
ma.machName,
ma.machType,
t.taskNo,
c.cropName,
c.cropType,
m.taskmachUsedcount,
ma.machNo,
ma.machSpec,
tc.taskrcdCompletedate,
m.taskmachInvestmentAmount,
u.userName AS taskManagername
FROM
FmsTaskmachine AS m
JOIN FmsTaskrcd AS tc ON m.taskrcdId = tc.taskrcdId
JOIN FmsTask AS t ON tc.taskId = t.taskId
JOIN FmsCrop AS c ON t.cropId = c.cropId
JOIN FmsMach AS ma ON m.machId = ma.machId
JOIN SysUser AS u ON t.taskManager = u.userId
JOIN FmsPlan AS p ON p.planId = t.planId
tc.taskrcdAuditstatus = '2' and machSystype = '0'
and machType = #{machType}
and t.blockId = #{blockId}
and machName like concat('%', #{machName}, '%')
and p.planNo like concat('%', #{planNo}, '%')
and t.taskNo like concat('%', #{taskNo}, '%')
and c.cropName like concat('%', #{cropName}, '%')
and u.userName like concat('%', #{taskManagername}, '%')
and tc.taskrcdCompletedate >= #{startDate}
and tc.taskrcdCompletedate #{endDate}
AND t.blockId in
#{item}
and m.tid = #{tid}
ORDER BY tc.taskrcdCompletedate DESC
select machId, machType, machName, machNo, machBrand, machSpec, machBuydate, machUsestatus, machOwnername, machOwnermobile from FmsMach
machSystype = '0'
and machType = #{machType}
and machName like concat('%', #{machName}, '%')
and machBrand like concat('%', #{machBrand}, '%')
and machUsestatus = #{machUsestatus}
and tid = #{tid}
ORDER BY machId DESC
SELECT
machType,
IFNULL( count( machType ), 0 ) AS num
FROM FmsMach
machSystype = '0' and tid = #{tid}
GROUP BY machType
select count(1) count from FmsMach
machSystype = '0'
and tid = #{tid}
insert into FmsMach
machId,
machType,
machName,
machNo,
machBrand,
machSpec,
machBuydate,
machUsestatus,
machOwnername,
machOwnermobile,
machSystype,
tid
#{machId},
#{machType},
#{machName},
#{machNo},
#{machBrand},
#{machSpec},
#{machBuydate},
#{machUsestatus},
#{machOwnername},
#{machOwnermobile},
'0',
#{tid}
update FmsMach
machType = #{machType},
machName = #{machName},
machNo = #{machNo},
machBrand = #{machBrand},
machSpec = #{machSpec},
machBuydate = #{machBuydate},
machUsestatus = #{machUsestatus},
machOwnername = #{machOwnername},
machOwnermobile = #{machOwnermobile},
tid = #{tid},
where machId = #{machId} and machSystype = '0' and tid = #{tid}
delete from FmsMach where machId = #{machId} and machSystype = '0' and tid = #{tid}
delete from FmsMach where machSystype = '0' and tid = #{tid} and machId in
#{machId}