select id, project_code, project_name,bg_property, customer_code, customer_name, industry_type, agent_code, project_stage, project_grasp_degree, hz_support_user, operate_institution , partner_code, partner_name, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration , key_problem, project_desc, create_by, create_time, update_by, update_time,customer_user_name,customer_phone,partner_email,partner_user_name,h3c_person,h3c_phone,poc from project_info t1 select t1.id, t1.project_code, t1.project_name, t1.bg_property, t1.customer_code, t1.customer_name, t1.industry_type, t1.agent_code, t1.project_stage, t1.project_grasp_degree, t1.hz_support_user, t1.operate_institution, t1.partner_code, t1.partner_name, t1.contact_way, t1.estimated_amount, t1.currency_type, t1.estimated_order_time, t1.estimated_deliver_time, t1.competitor, t1.country_product, t1.server_configuration, t1.key_problem, t1.project_desc, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.customer_user_name,t1.customer_phone,t1.partner_user_name,t1.h3c_person,t1.poc,t1.h3c_phone, t2.agent_name,t2.contact_email,t2.contact_phone,t2.contact_person, t3.user_name as hz_support_user_name, t5.level, t5.contact_email as partner_email, ifnull(t4.work_time,t1.update_time) as last_work_update_time from project_info t1 left join agent_info t2 on t1.agent_code = t2.agent_code left join sys_user t3 on t1.hz_support_user=t3.user_id left join partner_info t5 on t1.partner_code=t5.partner_code left join (select max(work_time) work_time,project_id from project_work_progress group by project_id) t4 ON t1.id=t4.project_id insert into project_info project_code, project_name, poc, customer_code, customer_name, customer_user_name, customer_phone, h3c_person, h3c_phone, industry_type, bg_property, agent_code, project_stage, project_grasp_degree, hz_support_user, operate_institution, partner_code, partner_name, partner_user_name, partner_email, contact_way, estimated_amount, currency_type, estimated_order_time, estimated_deliver_time, competitor, country_product, server_configuration, key_problem, project_desc, create_by, create_time, update_by, update_time, #{projectCode}, #{projectName}, #{poc}, #{customerCode}, #{customerName}, #{customerUserName}, #{customerPhone}, #{h3cPerson}, #{h3cPhone}, #{industryType}, #{bgProperty}, #{agentCode}, #{projectStage}, #{projectGraspDegree}, #{hzSupportUser}, #{operateInstitution}, #{partnerCode}, #{partnerName}, #{partnerUserName}, #{partnerEmail}, #{contactWay}, #{estimatedAmount}, #{currencyType}, #{estimatedOrderTime}, #{estimatedDeliverTime}, #{competitor}, #{countryProduct}, #{serverConfiguration}, #{keyProblem}, #{projectDesc}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, update project_info set customer_code = #{newValue} where customer_code = #{oldValue} update project_info project_code = #{projectCode}, project_name = #{projectName}, poc = #{poc}, customer_code = #{customerCode}, customer_name = #{customerName}, customer_user_name=#{customerUserName}, customer_phone=#{customerPhone}, h3c_phone=#{h3cPhone}, h3c_person=#{h3cPerson}, bg_property=#{bgProperty}, industry_type = #{industryType}, agent_code = #{agentCode}, project_stage = #{projectStage}, project_grasp_degree = #{projectGraspDegree}, hz_support_user = #{hzSupportUser}, operate_institution = #{operateInstitution}, partner_code = #{partnerCode}, partner_name = #{partnerName}, partner_user_name = #{partnerUserName}, partner_email=#{partnerEmail}, contact_way = #{contactWay}, estimated_amount = #{estimatedAmount}, currency_type = #{currencyType}, estimated_order_time = #{estimatedOrderTime}, estimated_deliver_time = #{estimatedDeliverTime}, competitor = #{competitor}, country_product = #{countryProduct}, server_configuration = #{serverConfiguration}, key_problem = #{keyProblem}, project_desc = #{projectDesc}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, where id = #{id} update project_info set estimated_order_time = now() where id = #{id} delete from project_info where id = #{id} delete from project_info where id in #{id}