|
- <?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="com.iformall.mapper.OrderCpsMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.OrderCps">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId"/>
- <result column="item_order_id" jdbcType="VARCHAR" property="itemOrderId" />
- <result column="sell_amount" jdbcType="INTEGER" property="sellAmount"/>
- <result column="source_type" jdbcType="INTEGER" property="sourceType"/>
- <result column="item_id" jdbcType="BIGINT" property="itemId"/>
- <result column="commission_amount" jdbcType="INTEGER" property="commissionAmount"/>
- <result column="commission_user_id" jdbcType="BIGINT" property="commissionUserId"/>
- <result column="commission_rate" jdbcType="INTEGER" property="commissionRate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`compose_order_id`,`item_order_id`,
- `sell_amount`,`source_type`,`item_id`,
- `commission_amount`,`commission_user_id`,`commission_rate`,
- `create_date`,`update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != composeOrderId ">
- and `compose_order_id` = #{composeOrderId}
- </if>
-
- <if test=" null != itemOrderId ">
- and `item_order_id` = #{itemOrderId}
- </if>
-
- <if test=" null != sourceType ">
- and `source_type` = #{sourceType}
- </if>
-
- <if test=" null != itemId ">
- and `item_id` = #{itemId}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select <include refid="allColumns"/> from order_cps where id =#{id} and tenant_id=#{tenantId}
- </select>
-
- <select id="findList" parameterType="com.iformall.domain.po.OrderCps" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from order_cps
- <include refid="dynamicWhereConditions"/>
- </select>
-
- </mapper>
|