| | |
| | | <select id="selectHkEventPage" resultType="cn.gistack.sm.hk.vo.HkEventVO"> |
| | | select |
| | | she.*, |
| | | awb."res_guid" as resGuid, |
| | | a."name" as resName, |
| | | case when b."ad_grad" = 4 THEN b."ad_name" |
| | | ELSE NULL END AS townName, |
| | | case when b."ad_grad" = 3 THEN b."ad_name" |
| | | when c."ad_grad" = 3 THEN C."ad_name" |
| | | END AS countyName, |
| | | case when b."ad_grad" = 2 THEN b."ad_name" |
| | | when c."ad_grad" = 2 THEN c."ad_name" |
| | | ELSE d."ad_name" END AS cityName, |
| | | bdb.dict_value as eventTypeName |
| | | from YWXT.sm_hk_event she |
| | | left join YWXT.blade_dict_biz bdb on bdb.dict_key = she.event_type and bdb.is_deleted = 0 and code = 'EVENT_TYPE' |
| | | left join SJZT_MD."att_wmst_base" awb on awb."video_guid" = she.src_index |
| | | left join SJZT_MD."att_res_base" a on a."guid" = awb."res_guid" |
| | | left join SJZT_MD."att_ad_base" b on b."guid" = a."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" c ON b."p_ad_code" = c."guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" d ON c."p_ad_code" = d."guid" |
| | | where 1 =1 |
| | | <if test="hkEvent.srcName!=null and hkEvent.srcName!=''"> |
| | | and she.src_name like concat('%',#{hkEvent.srcName},'%') |
| | |
| | | <if test="hkEvent.endTime !=null and hkEvent.endTime !=''"> |
| | | AND DATE_FORMAT(she.send_time,'%Y-%m-%d') <= #{hkEvent.endTime} |
| | | </if> |
| | | <if test="hkEvent.adCode != null and hkEvent.adCode !='' and hkEvent.adCode !='420000000000'"> |
| | | AND (b."ad_code" = #{hkEvent.adCode} or c."ad_code" =#{hkEvent.adCode} or d."ad_code" = #{hkEvent.adCode}) |
| | | </if> |
| | | order by she.id desc |
| | | </select> |
| | | |