const sql=`select hw.pmdmcode, hx.hxmc, sum (case when hw.hwh='LS-1-1-1' then ifnull (hw.hwsl,0) +0 else 0 end) SY,sum (case when hw.hwh != 'LS-1-1-1' then ifnull (hw.hwsl, 0) +0 else 0 end) YL from tab_bzgl_knzy_app_hwb hw inner join TAB_BZGL_KNZY_APP_HJB hj on hj.guid = hw.hjguid inner join TAB_BZGL_KNZY_APP_QYB gy on gy.guid = hj.qyguid left join TAB_XTWH_JCSJ_BZHX hx on hw.pmdmcode = hx.pmdmten where substr (hw.pmdmcode, 1, 6) = ${params.pmdmcode} and hw.kfguid = ${params.kfguid} and hw.gldwguid= ${params.gldwguid} and zmlx = ${params.zmlx} group by hw.pmdmcode, hx.hxmc`
return sql
}
/*验证扫描:验证扫描完的数据有没有*/
static testInsertSql(params?: any):string{
const sql= `select * from (select hw.*,qy.kfdm kfdm from tab_bzgl_knzy_app_hwb hw left join tab_bzgl_knzy_app_hjb hj on hj.guid = hw.hjguid left join tab_bzgl_knzy_app_qyb qy on qy.guid = hj.qyguid ) where kfguid = '${params.kfguid}' and hwh = ${params.hwh} and (pmdmcode = ${(params.pmdmcode)} or pmdmcode ='' or pmdmcode is null )`
return sql
}
/*验证扫描完更新*/
static updateWzcshSql(params?: any):string{
const sql=`update tab_bzgl_knzy_app_hwb set hwsl = ifnull(hwsl,0) + ${params.srsl}, pmdmcode = ${params.pmdmcode} where guid = ${params.guid}`