point-rule-mapper.xml
985 Bytes
<?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">
<!-- @author tongxiaochuan -->
<mapper namespace="com.cjs.cms.dao.user.point.PointRuleDao">
<sql id="point_rule_field">
id, active_id, gift_amount, start_rule, end_rule, sort, create_at, create_by
</sql>
<insert id="insert" parameterType="PointRuleInfo" useGeneratedKeys="true" keyProperty="id">
insert into point_rule(active_id, gift_amount, start_rule, end_rule, sort, create_at, create_by)
values(#{activeId}, #{giftAmount}, #{startRule}, #{endRule}, #{sort}, CURRENT_TIMESTAMP, #{createBy})
</insert>
<select id="queryByActiveId" parameterType="int" resultType="PointRuleInfo">
select <include refid="point_rule_field" /> from point_rule
where active_id = #{activeId}
</select>
<delete id="deleteByActiveId" parameterType="int">
delete from point_rule
where active_id = #{activeId}
</delete>
</mapper>