select * from TB_RY_RYCJ where (SCBZ='0' or SCBZ is null) and (ZJHM = #{zjhm , jdbcType=VARCHAR } OR GMSFHM = #{zjhm , jdbcType=VARCHAR }) order by lrsj desc
SELECT RYBH,
XM,
ZJHM,
GMSFHM,
EDZZPXXBH,
ZMZPXXBH,
CMZPXXBH,
YCMZPXXBH,
SZZWBH,
ZWCJSJ,
BZW,
R_SJLXDH,
ZWFKXX,
TBBZ,
LRDWDM,
LRR,
LRSJ,
(select count(1) from tb_xw_ythcj_hm s where s.rybh=TB_RY_RYCJ.rybh) as HM,
(select count(1) from tb_xw_ythcj_sw s where s.rybh=TB_RY_RYCJ.rybh) as SW,
(select count(1) from tb_xw_ythcj_zj s where s.rybh=TB_RY_RYCJ.rybh) as ZJ,
(select count(1) from tb_xw_ythcj_yhkjbxx s where s.rybh=TB_RY_RYCJ.rybh) as YHK,
(select count(1) from tb_ph_fzxyrsjgl s where s.xyrbh=TB_RY_RYCJ.rybh) as SJJBXX,
(select count(1) from tb_ph_lxrxx s where s.xyrbh=TB_RY_RYCJ.rybh) as SJLXRXX,
TB_RY_RYCJ.SCBZ,
(select name from sys_dictitem s where s.groupid='CODE_XB' and s.code = TB_RY_RYCJ.XBDM) as XBDM,
(select name from sys_dictitem s where s.groupid='CODE_UNIT' and s.code = TB_RY_RYCJ.ZWCJDWDM) as ZWCJDWDM,