select taskpickId, taskId, pickArea, pickWeight, pickDate, pickRemark, pickNo from FmsTaskpick
SELECT c.cropName, c.cropType, t.taskNo, t.taskId,r.resUrl as cropPreview, p.planNo, l.landName, b.blockName, p.planArea, i.pickWeight, i.pickNo, t.taskPlanstartdate, t.taskPlanenddate, s.taskrcdHour, t.taskCreateddate, t.taskAudittype, t.taskStatus, t.taskContent, t.taskAuditor,
su.userName as taskManagername
FROM
FmsTask t
LEFT JOIN FmsCrop c ON t.cropId = c.cropId
LEFT JOIN FmsLand l ON t.landId = l.landId
LEFT JOIN FmsBlock b ON t.blockId = b.blockId
LEFT JOIN FmsPlan p ON t.planId = p.planId
LEFT JOIN FmsTaskpick i ON t.taskId = i.taskId
LEFT JOIN FmsTaskrcd s ON t.taskId = s.taskId and s.taskrcdAuditstatus = 2
LEFT JOIN SysUser su on su.userId = t.taskManager
LEFT JOIN
(select * from SysRes where resMediatype = '1' and resBiztype = 'CROP')
r on r.resBusId = c.cropId
and t.cropId = #{cropId}
and t.landId = #{landId}
and t.blockId = #{blockId}
and t.planId = #{planId}
and t.taskId = #{taskId}
and t.taskNo like concat('%', #{taskNo}, '%')
and p.planNo like concat('%', #{planNo}, '%')
and i.pickNo like concat('%', #{pickNo}, '%')
and t.taskManagername like concat('%', #{taskManagername}, '%')
and t.taskStatus = #{taskStatus}
and t.taskAudittype = #{taskAudittype}
and t.taskPlanstartdate between #{taskPlanstartdate} and #{taskPlanenddate}
AND t.blockId in
#{item}
and t.tid = #{tid}
and t.taskType = -1
SELECT
t.cropId,c.cropName,c.cropType,sum(tp.pickWeight) as pickWeight
FROM
FmsTaskpick tp
LEFT JOIN FmsTask t on t.taskId = tp.taskId
LEFT JOIN FmsCrop c on c.cropId = t.cropId
t.cropId is not null
and tp.tid = #{tid}
and c.cropName like CONCAT("%",#{cropName},"%")
AND t.blockId in
#{item}
GROUP BY t.cropId,c.cropName,c.cropType
SELECT
t.cropId,c.cropName,c.cropType,sum(tp.pickWeight) as pickWeight
FROM
FmsTaskpick tp
LEFT JOIN FmsTask t on t.taskId = tp.taskId
LEFT JOIN FmsTaskrcd r on r.taskId = t.taskId
LEFT JOIN FmsCrop c on c.cropId = t.cropId
t.cropId is not null
and tp.tid = #{tid}
and t.taskStatus = #{taskStatus}
and t.landId = #{landId}
and t.blockId = #{blockId}
and t.blockId in
#{blockId}
GROUP BY t.cropId,c.cropName,c.cropType
select sum(tp.pickWeight) pickWeight, cropName
from FmsTaskpick tp
left join FmsTask t on t.taskId = tp.taskId
left join FmsCrop c on t.cropId = c.cropId
where
t.taskStatus = '3'
and tp.tid = #{tid}
and t.landId = #{landId}
and t.taskCompletedate >= #{startDate}
and t.taskCompletedate #{endDate}
AND t.landId in
#{item}
group by c.cropName
select sum(tp.pickWeight) pickWeight, l.landName, l.landId
from FmsTaskpick tp
left join FmsTask t on t.taskId = tp.taskId
left join FmsCrop c on t.cropId = c.cropId
left join FmsLand l on l.landId = t.landId
where
t.taskStatus = '3'
and l.landId is not null
and tp.tid = #{tid}
and t.landId = #{landId}
and t.taskCompletedate >= #{startDate}
and t.taskCompletedate #{endDate}
AND t.landId in
#{item}
group by l.landId
select sum(tp.pickWeight) pickWeight, b.blockName, b.blockId
from FmsTaskpick tp
left join FmsTask t on t.taskId = tp.taskId
left join FmsCrop c on t.cropId = c.cropId
left join FmsBlock b on b.blockId = t.blockId
where
t.taskStatus = '3'
and b.blockId is not null
and tp.tid = #{tid}
and t.landId = #{landId}
and t.taskCompletedate >= #{startDate}
and t.taskCompletedate #{endDate}
AND t.landId in
#{item}
group by b.blockId
SELECT
tp.pickNo,
p.planNo,
l.landName,
b.blockName,
p.planArea,
t.taskCompletedate,
tp.pickWeight
FROM
FmsTaskpick tp
LEFT JOIN FmsTask t on t.taskId = tp.taskId
LEFT JOIN FmsPlan p on p.planId = t.planId
LEFT JOIN FmsLand l on l.landId = t.landId
LEFT JOIN FmsBlock b on b.blockId = t.blockId
LEFT JOIN FmsTaskrcd r on r.taskId = t.taskId and r.taskrcdAuditstatus = '2'
t.cropId = #{cropId}
and
t.tid = #{tid}
and t.landId = #{landId}
and t.blockId = #{blockId}
and p.planNo = #{planNo}
and tp.pickNo = #{pickNo}
and t.taskCompletedate between #{taskCompletedatestart} and #{taskCompletedateend}
where taskpickId = #{taskpickId} and tid = #{tid}
where taskId = #{taskId} and tid = #{tid}
select tp.*, t.taskManagername, t.taskCompletedate
from FmsTaskpick tp
left join FmsTask t on tp.taskId = t.taskId
where
t.taskStatus = '3'
and
t.planId = #{planId} and t.tid = #{tid}
SELECT
ft.taskNo,
fl.landName,
fb.blockName,
fc.cropName,
fc.cropType,
ft.taskPlanstartdate,
ft.taskPlanenddate,
ftp.pickWeight,
ftr.taskrcdCost,
sum(fta.taskassetInvestmentAmount) as taskassetInvestmentAmount,
sum(ftm.taskmachInvestmentAmount) as taskmachInvestmentAmount,
ft.taskAudittype,
ft.taskStatus,
ft.taskCreateddate,
su.userName as taskManagername
FROM
FmsTask ft
LEFT JOIN FmsBlock fb ON fb.blockId = ft.blockId
LEFT JOIN FmsLand fl ON fb.landId = fl.landId
LEFT JOIN FmsCrop fc on fc.cropId = ft.cropId
LEFT JOIN FmsTaskpick ftp on ftp.taskId = ft.taskId
LEFT JOIN (select taskId,taskrcdId,taskrcdCost from FmsTaskrcd) ftr on ftr.taskId = ft.taskId
LEFT JOIN FmsTaskasset fta on fta.taskrcdId = ftr.taskrcdId
LEFT JOIN FmsTaskmachine ftm on ftm.taskrcdId = ftr.taskrcdId
LEFT JOIN FmsPlan fp on fp.planId = ft.planId
LEFT JOIN SysUser su on su.userId = ft.taskManager
and ft.cropId = #{cropId}
and ft.landId = #{landId}
and ft.blockId = #{blockId}
and ft.planId = #{planId}
and ft.taskId = #{taskId}
and ft.taskNo like concat('%', #{taskNo}, '%')
and fp.planNo like concat('%', #{planNo}, '%')
and ftp.pickNo like concat('%', #{pickNo}, '%')
and ft.taskManagername like concat('%', #{taskManagername}, '%')
and ft.taskStatus = #{taskStatus}
and ft.taskAudittype = #{taskAudittype}
and ft.taskPlanstartdate between #{taskPlanstartdate} and #{taskPlanenddate}
AND ft.blockId in
#{item}
and ft.tid = #{tid}
and ft.taskType = -1
group by ft.taskId
order by ft.taskCreateddate desc
insert into FmsTaskpick
taskpickId,
taskId,
pickArea,
pickWeight,
pickDate,
pickRemark,
pickNo,
tid,
#{taskpickId},
#{taskId},
#{pickArea},
#{pickWeight},
#{pickDate},
#{pickRemark},
#{pickNo},
#{tid},
update FmsTaskpick
taskId = #{taskId},
pickArea = #{pickArea},
pickWeight = #{pickWeight},
pickDate = #{pickDate},
pickRemark = #{pickRemark},
pickNo = #{pickNo},
pickChangestatus = #{pickChangestatus},
tid = #{tid},
where
taskpickId = #{taskpickId} and tid = #{tid}
delete from FmsTaskpick
where
taskpickId = #{taskpickId} and tid = #{tid}
delete from FmsTaskpick
where
taskpickId in
#{taskpickId}
and tid = #{tid}