| | |
| | | insertTime as insertTime |
| | | from t_company where flag != 3 and state = 0 and id in ( |
| | | select companyId from t_company_city where state = 1 |
| | | <if test="null != province and null != city and null != code"> |
| | | and provinceCode = #{province} and cityCode = #{city} and areaCode = #{code} |
| | | <if test="null != cityIds"> |
| | | and cityId in |
| | | <foreach collection="cityIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != province and null != city and null == code"> |
| | | and provinceCode = #{province} and cityCode = #{city} and (areaCode = '' or areaCode is null) |
| | | </if> |
| | | <if test="null != province and null == city and null == code"> |
| | | and provinceCode = #{province} and (cityCode = '' or cityCode is null) and (areaCode = '' or areaCode is null) |
| | | </if> |
| | | ) |
| | | ) order by `type` desc limit 0, 1 |
| | | </select> |
| | | |
| | | |