|
@ -10,6 +10,7 @@ |
|
|
j.status, |
|
|
j.status, |
|
|
j.device_id, |
|
|
j.device_id, |
|
|
j.operator_id, |
|
|
j.operator_id, |
|
|
|
|
|
j.duration, |
|
|
FROM_UNIXTIME(j.start_time / 1000, '%Y-%m-%d %H:%i:%s') as start_time_str, |
|
|
FROM_UNIXTIME(j.start_time / 1000, '%Y-%m-%d %H:%i:%s') as start_time_str, |
|
|
u1.nick_name as operator_name, |
|
|
u1.nick_name as operator_name, |
|
|
u1.phone as operator_phone, |
|
|
u1.phone as operator_phone, |
|
@ -28,23 +29,48 @@ |
|
|
left join ams_user u2 on j.farmer_id = u2.id |
|
|
left join ams_user u2 on j.farmer_id = u2.id |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="jobItem2"> |
|
|
|
|
|
select j.id as job_id, |
|
|
|
|
|
j.start_time, |
|
|
|
|
|
j.end_time, |
|
|
|
|
|
j.area, |
|
|
|
|
|
j.status, |
|
|
|
|
|
j.device_id, |
|
|
|
|
|
j.operator_id, |
|
|
|
|
|
j.duration, |
|
|
|
|
|
FROM_UNIXTIME(j.start_time / 1000, '%Y-%m-%d %H:%i:%s') as start_time_str, |
|
|
|
|
|
j.farmer_id, |
|
|
|
|
|
u2.nick_name as farmer_name, |
|
|
|
|
|
CONCAT(LEFT(u2.phone, 3), '****', RIGHT(u2.phone, 4)) as farmer_phone, |
|
|
|
|
|
u2.region_name, |
|
|
|
|
|
j.job_type, |
|
|
|
|
|
t.name as type_name, |
|
|
|
|
|
d.id as dept_id, |
|
|
|
|
|
d.name as dept_name |
|
|
|
|
|
from ams_job_info j |
|
|
|
|
|
left join ams_job_type t on j.job_type = t.id |
|
|
|
|
|
left join ams_dept d on j.dept_id = d.id |
|
|
|
|
|
left join ams_user u2 on j.farmer_id = u2.id |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="jobPage" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
<select id="jobPage" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
<include refid="jobItem"></include> |
|
|
<include refid="jobItem"></include> |
|
|
${ew.getCustomSqlSegment} |
|
|
${ew.getCustomSqlSegment} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="jobList" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
<select id="jobList" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
<include refid="jobItem"></include> |
|
|
|
|
|
${ew.getCustomSqlSegment} |
|
|
|
|
|
order by j.farmer_id,j.start_time |
|
|
|
|
|
|
|
|
<include refid="jobItem2"></include> |
|
|
|
|
|
${ew.getCustomSqlSegment} order by j.farmer_id,j.start_time |
|
|
</select> |
|
|
</select> |
|
|
<select id="jobListCountByFarmer" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
<select id="jobListCountByFarmer" resultType="com.jiagutech.ams.model.response.JobItem"> |
|
|
select ROUND(sum(j.area),2) as area,j.farmer_id, |
|
|
|
|
|
|
|
|
select ROUND(sum(j.area), 2) as area, |
|
|
|
|
|
j.farmer_id, |
|
|
u2.nick_name as farmer_name, |
|
|
u2.nick_name as farmer_name, |
|
|
j.job_type,t.name as type_name, |
|
|
|
|
|
|
|
|
j.job_type, |
|
|
|
|
|
t.name as type_name, |
|
|
d.id as dept_id, |
|
|
d.id as dept_id, |
|
|
d.name as dept_name, |
|
|
d.name as dept_name, |
|
|
u2.phone as farmer_phone, |
|
|
|
|
|
|
|
|
CONCAT(LEFT(u2.phone, 3), '****', RIGHT(u2.phone, 4)) as farmer_phone, |
|
|
u2.region_name, |
|
|
u2.region_name, |
|
|
FROM_UNIXTIME(MIN(start_time) / 1000, '%Y-%m-%d %H:%i:%s') as start_time_str |
|
|
FROM_UNIXTIME(MIN(start_time) / 1000, '%Y-%m-%d %H:%i:%s') as start_time_str |
|
|
from ams_job_info j |
|
|
from ams_job_info j |
|
@ -57,5 +83,4 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |