| | |
| | | <select id="selectAttResBaseGeneralInvestigation" |
| | | resultType="cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO"> |
| | | |
| | | SELECT base.* from ( |
| | | SELECT base.* from ( |
| | | select |
| | | a.*, |
| | | b."check_state" AS tb_state, |
| | |
| | | left join ywxt."att_ad_base" city on county."p_ad_code" = city."ad_code" |
| | | left join ywxt."att_ad_base" province on city."p_ad_code" = province."ad_code" |
| | | left join "SJZT_MD"."tb_res_general_investigation_state" b on a."code" = b."res_guid" |
| | | <if test="attResBase.tbYear !=null and attResBase.tbYear !=''"> |
| | | AND b."tb_year" = #{attResBase.tbYear} |
| | | </if> |
| | | <if test="attResBase.tbQuarter !=null and attResBase.tbQuarter !=''"> |
| | | AND b."tb_quarter" = #{attResBase.tbQuarter} |
| | | </if> |
| | | |
| | | left join |
| | | |
| | |
| | | <if test="attResBase.tbYear !=null and attResBase.tbYear !=''"> |
| | | AND TRGI."tb_year" = #{attResBase.tbYear} |
| | | </if> |
| | | <if test="attResBase.tbQuarter !=null and attResBase.tbQuarter !=''"> |
| | | AND TRGI."tb_quarter" = #{attResBase.tbQuarter} |
| | | </if> |
| | | group by TRGI."tb_state_id",TRGI."res_guid" |
| | | |
| | | ) tmp on tmp."tb_state_id" = b."guid" |
| | | |
| | | where 1 = 1 |
| | | <if test="attResBase.tbQuarter !=null and attResBase.tbQuarter !=''"> |
| | | AND b."tb_quarter" = #{attResBase.tbQuarter} |
| | | </if> |
| | | <if test="attResBase.name !=null and attResBase.name !=''"> |
| | | AND a."name" LIKE CONCAT('%',#{attResBase.name},'%') |
| | | </if> |