financial-web-server/service/src/main/resources/mapper/financial/SavingGoalMapper.xml

68 lines
2.8 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="cn.bunny.services.mapper.financial.SavingGoalMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.financial.SavingGoal">
<id column="id" property="id"/>
<id column="create_time" property="createTime"/>
<id column="update_time" property="updateTime"/>
<id column="create_user" property="createUser"/>
<id column="update_user" property="updateUser"/>
<id column="is_deleted" property="isDeleted"/>
<id column="user_id" property="userId"/>
<id column="status_type" property="statusType"/>
<id column="saving_goal_name" property="savingGoalName"/>
<id column="amount" property="amount"/>
<id column="duration" property="duration"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, create_time, update_time, create_user, update_user, is_deleted, user_id, status_type, saving_goal_name, amount, duration
</sql>
<!-- 分页查询用户储值内容 -->
<select id="selectListByPage" resultType="cn.bunny.dao.vo.financial.admin.SavingGoalVo">
select
base.*,
create_user.username as create_username,
update_user.username as update_username
from t_saving_goal base
left join sys_user create_user on create_user.id = base.create_user
left join sys_user update_user on update_user.id = base.update_user
<where>
base.is_deleted = 0
<if test="dto.id != null and dto.id != ''">
and base.id like CONCAT('%',#{dto.id},'%')
</if>
<if test="dto.userId != null and dto.userId != ''">
and base.user_id like CONCAT('%',#{dto.userId},'%')
</if>
<if test="dto.statusType != null and dto.statusType != ''">
and base.status_type like CONCAT('%',#{dto.statusType},'%')
</if>
<if test="dto.savingGoalName != null and dto.savingGoalName != ''">
and base.saving_goal_name like CONCAT('%',#{dto.savingGoalName},'%')
</if>
<if test="dto.amount != null and dto.amount != ''">
and base.amount like CONCAT('%',#{dto.amount},'%')
</if>
<if test="dto.duration != null and dto.duration != ''">
and base.duration like CONCAT('%',#{dto.duration},'%')
</if>
</where>
</select>
<!-- 物理删除用户储值 -->
<delete id="deleteBatchIdsWithPhysics">
delete
from t_saving_goal
where id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</delete>
</mapper>