forked from rongchao/epmet-cloud-rizhao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
2.5 KiB
50 lines
2.5 KiB
<?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.epmet.dao.PointRuleDao">
|
|
|
|
<resultMap type="com.epmet.entity.PointRuleEntity" id="pointRuleMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="ruleName" column="RULE_NAME"/>
|
|
<result property="ruleDesc" column="RULE_DESC"/>
|
|
<result property="eventCode" column="EVENT_CODE"/>
|
|
<result property="operateType" column="OPERATE_TYPE"/>
|
|
<result property="upLimit" column="UP_LIMIT"/>
|
|
<result property="upLimitDesc" column="UP_LIMIT_DESC"/>
|
|
<result property="upLimitPrefix" column="UP_LIMIT_PREFIX"/>
|
|
<result property="rulePeriod" column="RULE_PERIOD"/>
|
|
<result property="point" column="POINT"/>
|
|
<result property="pointUnit" column="POINT_UNIT"/>
|
|
<result property="enabledFlag" column="ENABLED_FLAG"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
<select id="selectFunctionIds" resultType="java.lang.String">
|
|
SELECT DISTINCT FUNCTION_ID FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
|
|
</select>
|
|
<select id="selectListByFunctionId" resultMap="pointRuleMap">
|
|
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT,ENABLED_FLAG FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND FUNCTION_ID = #{functionId,jdbcType=VARCHAR}
|
|
</select>
|
|
<update id="updateByCustomerId">
|
|
UPDATE point_rule
|
|
SET
|
|
POINT = #{point,jdbcType=INTEGER},
|
|
ENABLED_FLAG = #{enabledFlag,jdbcType=VARCHAR},
|
|
UP_LIMIT = #{upLimit,jdbcType=INTEGER}
|
|
WHERE id = #{id,jdbcType=VARCHAR} and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
|
|
</update>
|
|
|
|
<select id="selectByEventCodeAndCustomerId" resultType="com.epmet.entity.PointRuleEntity">
|
|
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT,ENABLED_FLAG,UP_LIMIT,OPERATE_TYPE
|
|
FROM point_rule
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND
|
|
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND EVENT_CODE = #{eventCode,jdbcType=VARCHAR}
|
|
</select>
|
|
</mapper>
|