mybatis plus标签 参数 map. 取值 无map.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.jysso.socheck.mapper.DbSoCheckMapper">

    <select id="pageByMaterial" parameterType="hashmap" resultType="org.jeecg.modules.jysso.socheck.entity.DbSoCheck">
        select db_so_check.* from db_so_check db_so_check
        left join db_so_cost_income db_so_cost_income on db_so_cost_income.so_check_pid = db_so_check.id
        where 1 = 1
        <if test="map.materialCode != null and map.materialCode != '' ">
            and db_so_cost_income.material_code = #{materialCode}
        </if>
        <if test="map.materialName != null and map.materialName != '' ">
            and db_so_cost_income.material_name like  CONCAT('%',#{materialName},'%')
        </if>
        <if test="map.materialspec != null and map.materialspec != '' ">
            and db_so_cost_income.materialspec like  CONCAT('%',#{materialspec},'%')
        </if>





        <include refid="assembling"/>
    </select>

    <!--检索条件拼装-->
    <sql id="assembling">
        <if test=" map.createTime_begin != null and map.createTime_begin != '' ">
            and pro_build_info.createTime &gt;= #{createTime_begin}
        </if>
        <if test=" map.createTime_end != null and map.createTime_end != '' ">
            and pro_build_info.createTime &lt;= #{createTime_end}
        </if>
        <if test=" map.updateTime_begin != null and map.updateTime_begin != '' ">
            and pro_build_info.updateTime &gt;= #{updateTime_begin}
        </if>
        <if test=" map.updateTime_end != null and map.updateTime_end != '' ">
            and pro_build_info.updateTime &lt;= #{updateTime_end}
        </if>



        <if test=" map.contractNumber != null and map.contractNumber != '' ">
            and pro_build_info.id = #{contractNumber}
        </if>
        <if test=" map.customerName != null and map.customerName != '' ">
            and pro_build_info.id = #{customerName}
        </if>
        <if test=" map.jsfs != null and map.jsfs != '' ">
            and pro_build_info.id = #{jsfs}
        </if>
        <if test=" map.sszq != null and map.sszq != '' ">
            and pro_build_info.sszq = #{sszq}
        </if>
        <if test=" map.jyfs != null and map.jyfs != '' ">
            and pro_build_info.jyfs = #{jyfs}
        </if>
        <if test=" map.customerType != null and map.jyfs != '' ">
            and pro_build_info.customer_type = #{customerType}
        </if>
        <if test=" map.exportOrg != null and map.exportOrg != '' ">
            and pro_build_info.export_org = #{exportOrg}
        </if>
        <if test=" map.originAddress != null and map.originAddress != '' ">
            and pro_build_info.origin_address = #{originAddress}
        </if>
        <if test=" map.inlandDestinationPort != null and map.inlandDestinationPort != '' ">
            and pro_build_info.inland_destination_port = #{inlandDestinationPort}
        </if>
        <if test=" map.inlandDestinationPort != null and map.inlandDestinationPort != '' ">
            and pro_build_info.inland_destination_port = #{inlandDestinationPort}
        </if>
    </sql>


</mapper>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值