application.*,
user.real_name as userName,
user2.real_name as repairUserName,
user3.real_name as checkUserName,
sb.name as sbName,part.name as partName,
sb.no as sbNo, sb.cph as sbCph, sb.model_id as modelId,
error.name as repairErrorTypeName,
dept.name as deptName
select
,
user4.real_name as repairUser,sbPos.name as positionName,
part.name as partName,userSecond.real_name as secondRepairUserName,
userThree.real_name as threeRepairUserName,userFour.real_name as fourRepairUserName
from t_repair_application_form application
left join t_sys_user user on application.user_id = user.user_id
left join t_sys_user user2 on application.repair_user_id = user2.user_id
left join t_sys_user user3 on application.check_user_id = user3.user_id
left join t_sys_user userSecond on application.second_repair_user = userSecond.user_id
left join t_sys_user userThree on application.three_repair_user = userThree.user_id
left join t_sys_user userFour on application.four_repair_user = userFour.user_id
left join t_sb_info sb on application.sb_id = sb.id
left join t_sb_position sbPos on sbPos.id = sb.position_id
left join t_sys_user user4 on sb.repair_user = user4.user_id
left join t_error_type error on application.repair_error_type_id = error.id
left join t_part_info part on application.part_id = part.id
left join t_sys_dept dept on application.dept_id = dept.dept_id
and (
application.no like concat('%',#{keyword},'%') or
application.content like concat('%',#{keyword},'%') or
application.remark like concat('%',#{keyword},'%') or
application.repair_content like concat('%',#{keyword},'%') or
application.check_content like concat('%',#{keyword},'%') or
application.examine_content like concat('%',#{keyword},'%') or
application.refuse_remark like concat('%',#{keyword},'%') or
application.repair_dispatch_remark like concat('%',#{keyword},'%') or
application.actual_user like concat('%',#{keyword},'%') or
application.out_no like concat('%',#{keyword},'%') or
sb.name like concat('%',#{keyword},'%') or
sb.no like concat('%',#{keyword},'%') or
sb.cph like concat('%',#{keyword},'%') or
sbPos.name like concat('%',#{keyword},'%') or
error.name like concat('%',#{keyword},'%') or
part.name like concat('%',#{keyword},'%') or
user.real_name like concat('%',#{keyword},'%') or
user2.real_name like concat('%',#{keyword},'%') or
user3.real_name like concat('%',#{keyword},'%') or
user4.real_name like concat('%',#{keyword},'%') or
userSecond.real_name like concat('%',#{keyword},'%') or
userThree.real_name like concat('%',#{keyword},'%') or
userFour.real_name like concat('%',#{keyword},'%')
)
and application.content like concat('%',#{content},'%')
and application.sb_id = #{sbId}
and application.category = #{category}
AND application.category in
#{item}
and sb.zbh = #{zbh}
and application.no = #{no}
and application.plan_flag = #{planFlag}
and application.status = #{status}
and application.status in
#{item}
and application.actual_user = #{actualUser}
and application.main_repair_id = #{mainRepairId}
and application.out_type = #{outType}
and application.type = #{type}
and application.user_id = #{userId}
and (application.repair_user_id = #{repairUserId} or application.repair_user_id is null)
and (application.repair_user_id = #{repairUserId} or application.second_repair_user = #{repairUserId} or application.three_repair_user = #{repairUserId} or application.four_repair_user = #{repairUserId})
and application.check_user_id = #{checkUserId}
and user2.real_name like concat('%',#{repairUserName},'%')
and application.apply_time = ]]> #{searchStartTime}
and application.apply_time #{searchEndTime}
and application.dept_id = #{deptId}
AND application.dept_id in
#{item}
select
from t_repair_application_form application
left join t_sys_user user on application.user_id = user.user_id
left join t_sys_user user2 on application.repair_user_id = user2.user_id
left join t_sys_user user3 on application.check_user_id = user3.user_id
left join t_sb_info sb on application.sb_id = sb.id
left join t_part_info part on application.part_id = part.id
left join t_error_type error on application.repair_error_type_id = error.id
left join t_sys_dept dept on application.dept_id = dept.dept_id
where application.id = #{id,jdbcType=VARCHAR}
select no
from t_repair_application_form
where id = #{id,jdbcType=VARCHAR}
SELECT DISTINCT application.sb_id
FROM t_repair_application_form application
AND application.sb_id IN
#{item}
AND application.status IN
#{item}
select application.repair_user_id as repairUserId,
user2.real_name as repairUserName,
count(1) as num,
IFNULL(sum(application.repair_minutes), 0) as totalRepairHours,
IFNULL(avg(application.repair_minutes), 0) as avgRepairHours,
IFNULL(sum(application.deal_minutes), 0) as totalDealHours
from t_repair_application_form application
left join t_sys_user user2 on application.repair_user_id = user2.user_id
application.repair_end_time is not null
and application.repair_user_id is not null and application.repair_user_id != ''
and application.repair_user_id = #{repairUserId}
and user2.real_name like concat('%',#{repairUserName},'%')
and application.repair_start_time = ]]> #{searchRepairStartTime}
and application.repair_start_time #{searchRepairEndTime}
group by application.repair_user_id
order by totalRepairHours desc
select application.sb_id as sbId,
sb.no as sbNo,
sb.name as sbName,
sbType.name as sbTypeName,
count(1) as num,
IFNULL(sum(application.repair_minutes), 0) as totalRepairHours,
IFNULL(avg(application.repair_minutes), 0) as avgRepairHours,
IFNULL(sum(application.deal_minutes), 0) as totalDealHours
from t_repair_application_form application
left join t_sb_info sb on application.sb_id = sb.id
left join t_sb_type sbType on sb.type_id = sbType.id
application.repair_end_time is not null
and application.sb_id is not null and application.sb_id != ''
and application.sb_id = #{sbId}
and (sb.name like concat('%',#{keyword},'%') or sb.no like concat('%',#{keyword},'%'))
and application.repair_start_time = ]]> #{searchRepairStartTime}
and application.repair_start_time #{searchRepairEndTime}
group by application.sb_id
order by totalRepairHours desc
select
from t_repair_application_form application
left join t_sys_user user on application.user_id = user.user_id
left join t_sys_user user2 on application.repair_user_id = user2.user_id
left join t_sys_user user3 on application.check_user_id = user3.user_id
left join t_sb_info sb on application.sb_id = sb.id
left join t_part_info part on application.part_id = part.id
left join t_error_type error on application.repair_error_type_id = error.id
left join t_sys_dept dept on application.dept_id = dept.dept_id
application.repair_end_time is not null
and application.repair_user_id = #{repairUserId}
and application.sb_id = #{sbId}
and application.repair_start_time = ]]> #{searchRepairStartTime}
and application.repair_start_time #{searchRepairEndTime}
order by application.repair_start_time desc
SELECT max(SUBSTRING(no from 18 for 20 )) from t_repair_application_form
and apply_time ]]> #{applyTimeStart}
and apply_time #{applyTimeEnd}
select application.sb_id as sbId,
sb.no as sbNo,
sb.name as sbName,
sbType.name as sbTypeName,
count(1) as num,
IFNULL(sum(application.repair_minutes), 0) as totalRepairHours,
IFNULL(avg(application.repair_minutes), 0) as avgRepairHours,
IFNULL(sum(application.deal_minutes), 0) as totalDealHours
from t_repair_application_form application
left join t_sb_info sb on application.sb_id = sb.id
left join t_sb_type sbType on sb.type_id = sbType.id
application.repair_end_time is not null
and application.sb_id is not null and application.sb_id != ''
and application.sb_id = #{sbId}
and (sb.name like concat('%',#{keyword},'%') or sb.no like concat('%',#{keyword},'%'))
and application.repair_start_time = ]]> #{searchRepairStartTime}
and application.repair_start_time #{searchRepairEndTime}
group by application.sb_id
having totalRepairHours > 0
order by totalRepairHours desc