| | |
| | | |
| | | |
| | | <select id="selectInformationPage" resultMap="informationResultMap"> |
| | | select * from sys_information where 1=1 |
| | | SELECT |
| | | i.*, |
| | | IFNULL(A.znum ,0) as znum, |
| | | IFNULL(B.cnum ,0) as cnum, |
| | | IFNULL(C.pnum ,0) as pnum |
| | | FROM |
| | | sys_information i |
| | | LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 GROUP BY dept_id ) A ON A.dept_id = i.departmentid |
| | | LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid |
| | | LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid |
| | | where 1=1 |
| | | <if test="information.enterprisename!=null and information.enterprisename!=''"> |
| | | and enterpriseName like concat(concat('%', #{information.enterprisename}),'%') |
| | | and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%') |
| | | </if> |
| | | <if test="information.representative!=null and information.representative!=''"> |
| | | and representative like concat(concat('%', #{information.representative}),'%') |
| | | and i.representative like concat(concat('%', #{information.representative}),'%') |
| | | </if> |
| | | <if test="information.stats!=null and information.stats!=''"> |
| | | and stats=#{stats} |
| | | and i.stats=#{information.stats} |
| | | </if> |
| | | <if test="information.jurisdiction!=null and information.jurisdiction!=''"> |
| | | and jurisdiction=#{jurisdiction} |
| | | <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1123598813738675201'"> |
| | | and i.jurisdiction=#{information.jurisdiction} |
| | | </if> |
| | | <if test="information.departmentid!=null and information.departmentid!=''"> |
| | | and i.departmentid=#{information.departmentid} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | AND A.jurisdiction=#{jurisdiction} |
| | | </if> |
| | | <if test="deptid!=null and deptid!=''"> |
| | | and A.dept_name like concat('%', #{deptid},'%') |
| | | and A.enterpriseName like concat('%', #{deptid},'%') |
| | | </if> |
| | | </select> |
| | | |