SQL语句拼接Mybatis教程 程序员文章站 2023-11-19 17:31:04 sql语句拼接mybatis教程 sql语句拼接mybatis教程 <select id="xxxxxxxxbyall" resulttype="xxx.xxx.xxxxxx.xx.xxx.xxxxxxxxxx"> select cc.* from cp_claim_customer cc <if test="supplier_result != null or supplier_status != null or submit_time1 != null or submit_time2 != null or supplier_delivery_time1 != null or supplier_delivery_time2 != null or supplier_claim_amount1 != null or supplier_claim_amount2 != null or supplier_is_return != null or supplier_accounts_code != null or supplier_delivery_code != null"> join cp_claim_supplier cs on cc.claim_supplier_code = cs.claim_supplier_code if> <where> <if test="claim_customer_code != null"> cc.claim_customer_code=#{claim_customer_code} if> <if test="material_code != null"> and cc.material_code=#{material_code} if> <if test="status != null"> and cc.status=#{status} if> <if test="accounts_code != null"> and cc.accounts_code=#{accounts_code} if> <if test="type != null"> and cc.type=#{type} if> <if test="approval_result != null"> and cc.approval_result=#{approval_result} if> <if test="supplier_result != null"> and cs.supplier_result=#{supplier_result} if> <if test="supplier_status != null"> and cs.supplier_status=#{supplier_status} if> <if test="claim_supplier_code != null"> and cs.claim_supplier_code=#{claim_supplier_code} if> <if test="create_time1 != null and create_time2 != null"> and cc.create_time between #{create_time1} and #{create_time2} if> <if test="responsible_party_type != null"> and cc.responsible_party_type=#{responsible_party_type} if> <if test="tech_act_batchcode != null"> and cc.tech_act_batchcode=#{tech_act_batchcode} if> <if test="delivery_order_code != null"> and cc.delivery_order_code=#{delivery_order_code} if> <if test="delivery_order_time1 != null and delivery_order_time2 != null"> and cc.delivery_order_time between #{delivery_order_time1} and #{delivery_order_time2} if> <if test="claim_survey != null"> and cc.claim_survey=#{claim_survey} if> <if test="material_name != null"> and cc.material_name=#{material_name} if> <if test="is_tosupplier != null"> and cc.is_tosupplier=#{is_tosupplier} if> <if test="claim_amount1 != null and claim_amount2 != null"> and cc.claim_amount between #{claim_amount1} and #{claim_amount2} if> <if test="claim_amount1 == null and claim_amount2 != null"> and cc.claim_amount = #{claim_amount2} if> <if test="claim_amount1 != null and claim_amount2 == null"> and cc.claim_amount = #{claim_amount1} if> <if test="is_return != null"> and cc.is_return=#{is_return} if> <if test="is_scrap != null"> and cc.is_scrap=#{is_scrap} if> <if test="supplier_claim_amount1 != null and supplier_claim_amount2 != null"> and cs.claim_amount between #{supplier_claim_amount1} and #{supplier_claim_amount2} if> <if test="supplier_claim_amount1 != null and supplier_claim_amount2 == null"> and cs.claim_amount = #{supplier_claim_amount1} if> <if test="supplier_claim_amount1 == null and supplier_claim_amount2 != null"> and cs.claim_amount = #{supplier_claim_amount2} if> <if test="supplier_is_return != null"> and cs.return_status=#{supplier_is_return} if> <if test="supplier_accounts_code != null"> and cs.accounts_code=#{supplier_accounts_code} if> <if test="supplier_delivery_code != null"> and cs.supplier_delivery_code=#{supplier_delivery_code} if> <if test="submit_time1 != null and submit_time2 != null"> and cs.submit_time between #{submit_time1} and #{submit_time2} if> <if test="supplier_delivery_time1 != null and supplier_delivery_time2 != null"> and cs.supplier_delivery_time between #{supplier_delivery_time1} and #{supplier_delivery_time2} if> where> order by cc.id desc select> 上一篇: 亚运会奖牌榜首是谁(亚运会奖牌排名榜) 下一篇: 不投资如何在网上赚钱 推荐阅读 SQL语句拼接Mybatis教程 mybatis中的动态SQL语句 idea mybatis配置log4j打印sql语句的示例 mybatis中SQL语句运用总结 Mybatis中的动态SQL语句解析 C#拼接SQL语句 用ROW_NUMBER实现的高效分页排序 SQL语句优化教程:加快查询速度、建立索引及优化sql实例 安装好oracle后创建表空间SQL语句教程 动态拼接SQL语句导致注入的简单例子 mybatis oracle proc 数据库测试没问题,java调用就异常 ORA-00900: 无效 SQL 语句