alive-admin/alive-server/target/classes/mapper/system/ActivityLogMapper.xml

145 lines
8.4 KiB
XML

<?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.ruoyi.system.mapper.ActivityLogMapper">
<resultMap type="com.ruoyi.system.domain.ActivityLog" id="ActivityLogResult">
<result property="id" column="id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="flag" column="flag" />
<result property="activityConfigId" column="activity_config_id" />
<result property="address" column="address" />
<result property="superiorAddress" column="superior_address" />
<result property="title" column="title" />
<result property="type" column="type" />
<result property="amount" column="amount" />
<result property="superiorAmount" column="superior_amount" />
<result property="endTime" column="end_time" />
<result property="configType" column="config_type" />
<result property="mark" column="mark" />
<result property="hashs" column="hashs" />
<result property="transferType" column="transfer_type" />
</resultMap>
<sql id="selectActivityLogVo">
select id, create_time, update_time, flag, activity_config_id, address, superior_address, title, type, amount, superior_amount, end_time, config_type, mark, hashs, transfer_type from activity_log
</sql>
<select id="selectActivityLogList" parameterType="com.ruoyi.system.domain.ActivityLog" resultMap="ActivityLogResult">
<include refid="selectActivityLogVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
<if test="activityConfigId != null "> and activity_config_id = #{activityConfigId}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="superiorAddress != null and superiorAddress != ''"> and superior_address = #{superiorAddress}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="type != null "> and type = #{type}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="superiorAmount != null "> and superior_amount = #{superiorAmount}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="configType != null "> and config_type = #{configType}</if>
<if test="mark != null and mark != ''"> and mark = #{mark}</if>
<if test="hashs != null and hashs != ''"> and hashs like concat('%', #{hashs}, '%')</if>
<if test="transferType != null "> and transfer_type = #{transferType}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and create_time between #{params.beginTime} and #{params.endTime}</if>
</where>
order by id desc
</select>
<select id="findActivityLog" parameterType="com.ruoyi.system.domain.ActivityLog" resultMap="ActivityLogResult">
<include refid="selectActivityLogVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
<if test="activityConfigId != null "> and activity_config_id = #{activityConfigId}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="superiorAddress != null and superiorAddress != ''"> and superior_address = #{superiorAddress}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="type != null "> and type = #{type}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="superiorAmount != null "> and superior_amount = #{superiorAmount}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="configType != null "> and config_type = #{configType}</if>
<if test="mark != null and mark != ''"> and mark = #{mark}</if>
<if test="hashs != null and hashs != ''"> and hashs = #{hashs}</if>
<if test="transferType != null "> and transfer_type = #{transferType}</if>
</where>
limit 1
</select>
<select id="selectActivityLogById" parameterType="Integer" resultMap="ActivityLogResult">
<include refid="selectActivityLogVo"/>
where id = #{id}
</select>
<insert id="insertActivityLog" parameterType="com.ruoyi.system.domain.ActivityLog" useGeneratedKeys="true" keyProperty="id">
insert into activity_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="flag != null and flag != ''">flag,</if>
<if test="activityConfigId != null">activity_config_id,</if>
<if test="address != null and address != ''">address,</if>
<if test="superiorAddress != null">superior_address,</if>
<if test="title != null and title != ''">title,</if>
<if test="type != null">type,</if>
<if test="amount != null">amount,</if>
<if test="superiorAmount != null">superior_amount,</if>
<if test="endTime != null">end_time,</if>
<if test="configType != null">config_type,</if>
<if test="mark != null and mark != ''">mark,</if>
<if test="hashs != null">hashs,</if>
<if test="transferType != null">transfer_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="flag != null and flag != ''">#{flag},</if>
<if test="activityConfigId != null">#{activityConfigId},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="superiorAddress != null">#{superiorAddress},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="type != null">#{type},</if>
<if test="amount != null">#{amount},</if>
<if test="superiorAmount != null">#{superiorAmount},</if>
<if test="endTime != null">#{endTime},</if>
<if test="configType != null">#{configType},</if>
<if test="mark != null and mark != ''">#{mark},</if>
<if test="hashs != null">#{hashs},</if>
<if test="transferType != null">#{transferType},</if>
</trim>
</insert>
<update id="updateActivityLog" parameterType="com.ruoyi.system.domain.ActivityLog">
update activity_log
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="flag != null and flag != ''">flag = #{flag},</if>
<if test="activityConfigId != null">activity_config_id = #{activityConfigId},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="superiorAddress != null">superior_address = #{superiorAddress},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="type != null">type = #{type},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="superiorAmount != null">superior_amount = #{superiorAmount},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="configType != null">config_type = #{configType},</if>
<if test="mark != null and mark != ''">mark = #{mark},</if>
<if test="hashs != null">hashs = #{hashs},</if>
<if test="transferType != null">transfer_type = #{transferType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteActivityLogByIds" parameterType="String">
delete from activity_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>