select id, step, xm, xb, mz, zzmm, xh, rxsj, csny, dh, nj, xy, zy, bj, kndj, knlx, knlx2, rkzs, yzsr, rjyr, srly, jtcy, sqly, fdyqm, fdyqmrq, ejxyldqm, ejxyldqmrq, xsqm, xsqmrq, csdj, zzdj, zzls, zp,affix_id,status1,status2,status3,dz,yb,xxyjrq,apply_year,locked,level, EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = srs_zxj_apply.xh and (penalty_status = 0 or penalty_status = 2)) as penalty_status0, EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = srs_zxj_apply.xh and (penalty_status = 1 )) as penalty_status1, EXISTS(SELECT application_id FROM rt_stu_disciplinary_application rsda WHERE rsda.stu_no = srs_zxj_apply.xh and (penalty_status = 3 )) as penalty_status3, sfzhm, gyhd, bankCard, bankAddr, rjnsr, bjyj, bjyjdj, ejxyyj, ejxyyjdj, xxyj, xxqm, stu_year_id,fdygh,fdymc,ejxyldmc,ejxyldgh,xxmc,xxgh from srs_zxj_apply insert into srs_zxj_apply step, xm, xb, mz, zzmm, xh, rxsj, csny, dh, nj, xy, zy, bj, kndj, knlx, knlx2, rkzs, yzsr, rjyr, srly, jtcy, sqly, fdyqm, fdyqmrq, ejxyldqm, ejxyldqmrq, xsqm, xsqmrq, csdj, zzdj, zzls, zp, affix_id, status1, status2, status3, dz, yb, xxyjrq, apply_year, sfzhm, gyhd, bankCard, bankAddr, rjnsr, bjyj, bjyjdj, ejxyyj, ejxyyjdj, xxyj, xxqm, stu_year_id, fdymc, fdygh, ejxyldmc, ejxyldgh, xxmc, xxgh, #{step}, #{xm}, #{xb}, #{mz}, #{zzmm}, #{xh}, #{rxsj}, #{csny}, #{dh}, #{nj}, #{xy}, #{zy}, #{bj}, #{kndj}, #{knlx}, #{knlx2}, #{rkzs}, #{yzsr}, #{rjyr}, #{srly}, #{jtcy}, #{sqly}, #{fdyqm}, #{fdyqmrq}, #{ejxyldqm}, #{ejxyldqmrq}, #{xsqm}, #{xsqmrq}, #{csdj}, #{zzdj}, #{zzls}, #{zp}, #{affixId}, #{status1}, #{status2}, #{status3}, #{dz}, #{yb}, #{xxyjrq}, #{applyYear}, #{sfzhm}, #{gyhd}, #{bankCard}, #{bankAddr}, #{rjnsr}, #{bjyj}, #{bjyjdj}, #{ejxyyj}, #{ejxyyjdj}, #{xxyj}, #{xxqm}, #{stuYearId}, #{fdymc}, #{fdygh}, #{ejxyldmc}, #{ejxyldgh}, #{xxmc}, #{xxgh}, update srs_zxj_apply step = #{step}, xm = #{xm}, xb = #{xb}, mz = #{mz}, zzmm = #{zzmm}, xh = #{xh}, rxsj = #{rxsj}, csny = #{csny}, dh = #{dh}, nj = #{nj}, xy = #{xy}, zy = #{zy}, bj = #{bj}, kndj = #{kndj}, knlx = #{knlx}, knlx2 = #{knlx2}, rkzs = #{rkzs}, yzsr = #{yzsr}, rjyr = #{rjyr}, srly = #{srly}, jtcy = #{jtcy}, sqly = #{sqly}, fdyqm = #{fdyqm}, fdyqmrq = #{fdyqmrq}, ejxyldqm = #{ejxyldqm}, ejxyldqmrq = #{ejxyldqmrq}, xsqm = #{xsqm}, xsqmrq = #{xsqmrq}, csdj = #{csdj}, zzdj = #{zzdj}, zzls = #{zzls}, zp = #{zp}, affix_id = #{affixId}, status1 = #{status1}, status2 = #{status2}, status3 = #{status3}, dz = #{dz}, yb = #{yb}, xxyjrq = #{xxyjrq}, apply_year = #{applyYear}, sfzhm = #{sfzhm}, gyhd = #{gyhd}, bankCard = #{bankCard}, bankAddr = #{bankAddr}, rjnsr = #{rjnsr}, bjyj = #{bjyj}, bjyjdj = #{bjyjdj}, ejxyyj = #{ejxyyj}, ejxyyjdj = #{ejxyyjdj}, xxyj = #{xxyj}, xxqm = #{xxqm}, stu_year_id = #{stuYearId}, fdymc = #{fdymc}, fdygh = #{fdygh}, ejxyldmc = #{ejxyldmc}, ejxyldgh = #{ejxyldgh}, xxmc = #{xxmc}, xxgh = #{xxgh}, level = #{level}, where id = #{id} delete from srs_zxj_apply where id = #{id} delete from srs_zxj_apply where id in #{id} update srs_zxj_apply a left join srs_zxj_apply b on a.id = b.id a.step = #{step}, a.fdyqm = #{fdyqm}, a.fdyqmrq = #{fdyqmrq}, a.ejxyyj = b.bjyj, a.ejxyyjdj = b.bjyjdj, a.ejxyldqm = #{ejxyldqm}, a.ejxyldqmrq = #{ejxyldqmrq}, a.csdj = #{csdj}, a.xxyj = b.bjyj, a.xxqm = #{xxqm}, a.zzdj = b.bjyjdj, a.xxyjrq = #{xxyjrq}, a.status1 = #{status1}, a.status2 = #{status2}, a.status3 = #{status3}, a.bjyj = #{bjyj}, a.bjyjdj = #{bjyjdj}, a.fdygh = #{fdygh}, a.ejxyldmc = #{ejxyldmc}, a.ejxyldgh = #{ejxyldgh}, a.xxmc = #{xxmc}, a.xxgh = #{xxgh}, where a.id in #{id} update srs_zxj_apply set step = #{targetStep} ,bjyjdj = null ,fdyqm = null ,status1 = '未审核' ,ejxyyjdj = null ,ejxyldqm = null ,status2 = '未审核' ,zzdj = null ,xxqm = null ,status3 = '未审核' where id = #{id} and step = #{step} and step != -1 update srs_zxj_apply set locked = 1, locked_time = now() where id = #{id} update srs_zxj_apply set locked = 0, locked_time = null where id = #{id} update srs_zxj_apply set xsqm = #{qm} where xsqm is not null and xh = #{gh} update srs_zxj_apply set fdyqm = #{qm} where fdyqm is not null and fdygh = #{gh} update srs_zxj_apply set ejxyldqm = #{qm} where ejxyldqm is not null and ejxyldgh = #{gh} update srs_zxj_apply set xxqm = #{qm} where xxqm is not null and xxgh = #{gh}