| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?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.ym.mec.biz.dal.dao.SysPaymentConfigDao">
- <resultMap id="SysPaymentConfig" type="com.ym.mec.biz.dal.entity.SysPaymentConfig">
- <!--@Table sys_payment_config-->
- <id column="id_" jdbcType="INTEGER" property="id"/>
- <result column="organ_id_" property="organId"/>
- <result column="pay_type_" property="payType"/>
- <result column="yq_mer_no_" property="yqMerNo"/>
- <result column="hf_mer_no_" property="hfMerNo"/>
- <result column="type_" property="type"/>
- <result column="route_scale_" property="routeScale"/>
- <result column="organ_name" property="organName"/>
- <result column="per_scale_" property="perScale"/>
- <result column="com_scale_" property="comScale"/>
- <result column="course_fee_" property="courseFee"/>
- <result column="instrument_fee_" property="instrumentFee"/>
- <result column="accessories_fee_" property="accessoriesFee"/>
- <result column="other_fee_" property="otherFee"/>
- <result column="create_time_" property="createTime"/>
- <result column="update_time_" property="updateTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id_, organ_id_,pay_type_,yq_mer_no_,hf_mer_no_,type_,route_scale_,create_time_, update_time_
- </sql>
- <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
- <!--@mbg.generated-->
- select
- <include refid="Base_Column_List"/>
- from sys_payment_config
- where id_ = #{id,jdbcType=INTEGER}
- </select>
- <delete id="delete" parameterType="java.lang.Integer">
- delete
- from sys_payment_config
- where id_ = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.SysPaymentConfig"
- useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into sys_payment_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="organId != null">
- organ_id_,
- </if>
- <if test="payType != null">
- pay_type_,
- </if>
- <if test="yqMerNo != null">
- yq_mer_no_,
- </if>
- <if test="hfMerNo != null">
- hf_mer_no_,
- </if>
- <if test="routeScale != null">
- route_scale_,
- </if>
- <if test="type != null">
- type_,
- </if>
- <if test="createTime != null">
- create_time_,
- </if>
- <if test="updateTime != null">
- update_time_,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="organId != null">
- #{organId},
- </if>
- <if test="payType != null">
- #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- </if>
- <if test="yqMerNo != null">
- #{yqMerNo},
- </if>
- <if test="hfMerNo != null">
- #{hfMerNo},
- </if>
- <if test="routeScale != null">
- #{routeScale},
- </if>
- <if test="type != null">
- #{type},
- </if>
- <if test="createTime != null">
- #{createTime},
- </if>
- <if test="updateTime != null">
- #{updateTime},
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysPaymentConfig">
- <!--@mbg.generated-->
- update sys_payment_config
- <set>
- <if test="organId != null">
- organ_id_ = #{organId},
- </if>
- <if test="payType != null">
- pay_type_ = #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- </if>
- <if test="yqMerNo != null">
- yq_mer_no_ = #{yqMerNo},
- </if>
- <if test="hfMerNo != null">
- hf_mer_no_ = #{hfMerNo},
- </if>
- <if test="routeScale != null">
- route_scale_ = #{routeScale},
- </if>
- <if test="type != null">
- type_ = #{type},
- </if>
- update_time_ = now()
- </set>
- where id_ = #{id,jdbcType=INTEGER}
- </update>
- <!-- 全查询 -->
- <select id="findAll" resultMap="SysPaymentConfig">
- SELECT *
- FROM sys_payment_config
- ORDER BY id_
- </select>
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="SysPaymentConfig" parameterType="map">
- SELECT spc.*,o.name_ organ_name FROM sys_payment_config spc LEFT JOIN organization o on spc.organ_id_ = o.id_
- <include refid="global.limit"/>
- </select>
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(*) FROM sys_payment_config
- <include refid="global.limit"/>
- </select>
- <!-- 按分部编号查配置 -->
- <select id="findPaymentConfigByOrganId" resultMap="SysPaymentConfig">
- SELECT *
- FROM sys_payment_config
- WHERE organ_id_ = #{organId}
- </select>
- <select id="findPaymentConfigByOrganIds" resultMap="SysPaymentConfig">
- SELECT *
- FROM sys_payment_config
- WHERE organ_id_ IN
- <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
- #{organId}
- </foreach>
- </select>
- <!-- 根据支付类型获取支付配置 -->
- <select id="getPaymentConfigs" resultMap="SysPaymentConfig">
- SELECT spc.*, o.name_ organ_name
- FROM sys_payment_config spc
- LEFT JOIN organization o on spc.organ_id_ = o.id_
- <where>
- <if test="payType == null">
- pay_type_ IS NOT NULL
- AND (spc.yq_mer_no_ IS NOT NULL OR spc.hf_mer_no_ IS NOT NULL)
- </if>
- <if test="payType != null">
- AND pay_type_ = #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
- </if>
- <if test='payType != null and payType.code.equals("YQPAY")'>
- AND spc.yq_mer_no_ IS NOT NULL
- </if>
- <if test='payType != null and payType.code.equals("ADAPAY")'>
- AND spc.hf_mer_no_ IS NOT NULL
- </if>
- </where>
- </select>
- </mapper>
|