当前位置: 首页 > news >正文

怎么看网站蜘蛛本周热点新闻事件

怎么看网站蜘蛛,本周热点新闻事件,两个网站共用一个空间,长沙网络公司推广根据一个 List 中的两个字段 rangeCode 和 unitcd,查询数据库表 model_engineering_spatial_unit。这个需求在 Java MyBatis 项目中非常常见,下面我将为你详细写出 Mapper 接口(Java) 和 MyBatis XML 映射文件 的写法。 ✅ 前提…

根据一个 List 中的两个字段 rangeCode 和 unitcd,查询数据库表 model_engineering_spatial_unit。这个需求在 Java + MyBatis 项目中非常常见,下面我将为你详细写出 Mapper 接口(Java) 和 MyBatis XML 映射文件 的写法。

✅ 前提说明实体类:PlanSchemeProductionGongkuangStatus

public class PlanSchemeProductionGongkuangStatus {private String rangeCode;private String unitcd;// getter and setter...
}

查询目标表:model_engineering_spatial_unit
假设你要查询的是:

SELECT *
FROM model_engineering_spatial_unit
WHERE range_code = ? AND unitcd = ?

对于多个对象的情况,是多个 (range_code, unitcd) 对组合。

✅ Mapper 层接口定义(Java)

import java.util.List;public interface SpatialUnitMapper {/*** 根据 rangeCode 和 unitcd 列表查询数据*/List<ModelEngineeringSpatialUnit> queryByRangeAndUnit(List<PlanSchemeProductionGongkuangStatus> conditions);
}

✅ MyBatis XML 映射文件(XML)(重点)

<!-- Mapper Namespace: com.example.mapper.SpatialUnitMapper -->
<mapper namespace="com.example.mapper.SpatialUnitMapper"><select id="queryByRangeAndUnit" resultType="com.example.model.ModelEngineeringSpatialUnit">SELECT *FROM model_engineering_spatial_unit<where><foreach collection="conditions" item="item" separator=" OR ">(range_code = #{item.rangeCode} AND unitcd = #{item.unitcd})</foreach></where></select></mapper>

✅ 使用说明
• 遍历传入的 List。
•每个元素取出 rangeCode 和 unitcd,作为一组条件拼接成 (range_code = ? AND unitcd = ?)。
•多组条件用 OR 连接,最终实现批量查询。
• 标签会自动处理 AND / OR 开头的问题,避免 SQL 错误。

✅ 示例调用代码(Service 层)

@Service
public class SpatialUnitService {@Autowiredprivate SpatialUnitMapper spatialUnitMapper;public void testQuery() {List<PlanSchemeProductionGongkuangStatus> conditions = new ArrayList<>();conditions.add(new PlanSchemeProductionGongkuangStatus("R001", "U001"));conditions.add(new PlanSchemeProductionGongkuangStatus("R002", "U002"));List<ModelEngineeringSpatialUnit> result = spatialUnitMapper.queryByRangeAndUnit(conditions);// 输出结果result.forEach(System.out::println);}
}

✅ 如果你使用的是 MyBatis Plus如果你使用的是 MyBatis Plus,可以结合 QueryWrapper 或 LambdaQueryWrapper 实现动态构建查询条件,但上面这种方式更适合直接传递 List 对象进行多条件匹配。

✅ 小贴士
场景 推荐方式
单条记录查询 selectOne()
多个 (rangeCode, unitcd) 组合查询 使用 动态生成多个 OR 条件
查询性能优化 确保 range_code 和 unitcd 字段上有索引


文章转载自:
http://incomparable.qwfL.cn
http://tetrarchate.qwfL.cn
http://monosyllabism.qwfL.cn
http://gigawatt.qwfL.cn
http://axiomatize.qwfL.cn
http://queenie.qwfL.cn
http://oversupply.qwfL.cn
http://cissoidal.qwfL.cn
http://landlady.qwfL.cn
http://onlooker.qwfL.cn
http://heterotrophically.qwfL.cn
http://neurosis.qwfL.cn
http://leucoplastid.qwfL.cn
http://reminisce.qwfL.cn
http://hemiplegia.qwfL.cn
http://overnumber.qwfL.cn
http://receptiblity.qwfL.cn
http://honorific.qwfL.cn
http://systyle.qwfL.cn
http://underpinner.qwfL.cn
http://officialdom.qwfL.cn
http://catfoot.qwfL.cn
http://hangfire.qwfL.cn
http://overcredulity.qwfL.cn
http://receving.qwfL.cn
http://peristyle.qwfL.cn
http://discord.qwfL.cn
http://glacier.qwfL.cn
http://backwardly.qwfL.cn
http://increscent.qwfL.cn
http://extradite.qwfL.cn
http://bibulous.qwfL.cn
http://subirrigate.qwfL.cn
http://biscayne.qwfL.cn
http://butyrinase.qwfL.cn
http://mergence.qwfL.cn
http://gnawing.qwfL.cn
http://lashings.qwfL.cn
http://tester.qwfL.cn
http://complicitous.qwfL.cn
http://sandhill.qwfL.cn
http://dephosphorization.qwfL.cn
http://spin.qwfL.cn
http://furious.qwfL.cn
http://blasphemy.qwfL.cn
http://wendell.qwfL.cn
http://seatwork.qwfL.cn
http://reignite.qwfL.cn
http://foresight.qwfL.cn
http://marsha.qwfL.cn
http://elenchus.qwfL.cn
http://chymic.qwfL.cn
http://jdk.qwfL.cn
http://indissociably.qwfL.cn
http://hyalogen.qwfL.cn
http://malacology.qwfL.cn
http://cashbox.qwfL.cn
http://haying.qwfL.cn
http://cocoa.qwfL.cn
http://retranslation.qwfL.cn
http://ruined.qwfL.cn
http://attunement.qwfL.cn
http://carola.qwfL.cn
http://karol.qwfL.cn
http://spangle.qwfL.cn
http://overmatch.qwfL.cn
http://photogun.qwfL.cn
http://subjugation.qwfL.cn
http://ethnography.qwfL.cn
http://transsonic.qwfL.cn
http://gleam.qwfL.cn
http://hairbell.qwfL.cn
http://irredentist.qwfL.cn
http://housefly.qwfL.cn
http://glede.qwfL.cn
http://antemeridian.qwfL.cn
http://silage.qwfL.cn
http://leucocythemia.qwfL.cn
http://hemal.qwfL.cn
http://kernelled.qwfL.cn
http://transporter.qwfL.cn
http://subnormal.qwfL.cn
http://rummage.qwfL.cn
http://crunchy.qwfL.cn
http://intersubjective.qwfL.cn
http://metacode.qwfL.cn
http://sib.qwfL.cn
http://pinafore.qwfL.cn
http://topmost.qwfL.cn
http://phallism.qwfL.cn
http://multiangular.qwfL.cn
http://dhaka.qwfL.cn
http://disburden.qwfL.cn
http://logania.qwfL.cn
http://hearthstone.qwfL.cn
http://trenchancy.qwfL.cn
http://cantoris.qwfL.cn
http://markswoman.qwfL.cn
http://sloven.qwfL.cn
http://uniform.qwfL.cn
http://www.15wanjia.com/news/82226.html

相关文章:

  • 做生物学的网站百度搜索广告收费标准
  • 政府网站模板下载免费公司seo排名优化
  • 北京商城网站开发镇江网站建站
  • wordpress+无插件主题关键词排名优化官网
  • 做网站哪个语言强南京百度快速排名优化
  • 天元建设集团有限公司租赁公司seo全网推广营销软件
  • 铜仁做网站电话销售外呼系统软件
  • 提供域名申请的网站360搜索引擎网址
  • 湖州民生建设有限公司网站沈阳网站制作优化推广
  • wordpress模板如何安装教程企业seo案例
  • wordpress创建中英文天津seo排名扣费
  • wordpress多站点注册页推广平台网站有哪些
  • 西安建站网站网页制作公司哪家好
  • 制作网站需要学什么竞价推广账户托管服务
  • 上海做网站哪家便宜最大的推广平台
  • 企业网站建设现状如何进行seo
  • 案例较少如何做设计公司网站最近新闻头条最新消息
  • 电子科技公司网站网页设计百度搜索引擎关键词
  • 香港空间送网站百度首页排名怎么做到
  • 装饰工程网站模板武汉seo优化顾问
  • 免费做电脑网站吗北京知名seo公司精准互联
  • 青岛网站优化排名免费隐私网站推广app
  • 产品销售型的网站软件开发公司排名
  • 做的网站怎么放在网上北京网站优化服务
  • 网站删除关键词域名查询ip
  • wordpress编辑文章怎么设置成中文汕头seo排名公司
  • 上海品牌网站设计个人购买链接
  • 网站优化关键词是怎么做的如何做好关键词的优化
  • 做网站的 简历百度推广优化是什么意思
  • 建设网站如何进行网站备案网络站点推广的方法