bd.bdbm as bdbm, bd.bdh as bdh, bd.apbm as apbm cc.apcc as apcc, MAX(to_char(cc.jyrq, 'yyyy年MM月dd日')) as cjrq, MAX(wt.jyfs) as jyfs, MAX(wt.jyfx) as jyfx, MAX(wt.jyfxmc) as jyfxmc, MAX(wt.jyfsmc) as jyfsmc, MAX(wt.wtfmc) as wtfmc, MAX(cc.wtfbm) as wtfbm, MAX(ht.pzmc) as pzmc, MAX(ht.pzbm) as pzbm, MAX(wt.lsxzbm) as lsxzbm, MAX(CASE ht.jylx WHEN '0' THEN ht.cmmc WHEN '1' THEN ht.sgmc ELSE NULL END) as sgmc, MAX(cc.ccbm) as ccbm insert into ty_dcjybzxx (id, bdh, htbh, tsbz, yy, bjr, bjrq) values (#{id}, #{bdh}, #{htbh}, #{tsbz}, #{yy}, #{bjr}, #{bjrq}) update ty_dcjybzxx set bdh = #{bdh}, htbh = #{htbh}, tsbz = #{tsbz}, yy = #{yy}, bjr = #{bjr}, bjrq = #{bjrq} where id = #{id}