2024-10-01 22:23:00 +08:00
|
|
|
<?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">
|
2024-10-02 14:48:56 +08:00
|
|
|
<mapper namespace="cn.bunny.services.mapper.${originalName}Mapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="$type">
|
2024-10-10 16:58:31 +08:00
|
|
|
#foreach($field in $baseResultMaps)
|
|
|
|
<id column="$field.column" property="$field.property"/>
|
|
|
|
#end
|
2024-10-02 14:48:56 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
$baseColumnList
|
|
|
|
</sql>
|
2024-10-01 22:23:00 +08:00
|
|
|
|
|
|
|
<!-- 分页查询${classTitle}内容 -->
|
2024-10-31 10:01:58 +08:00
|
|
|
<select id="selectListByPage" resultType="${type}Vo">
|
2024-10-10 16:58:31 +08:00
|
|
|
select
|
2024-10-31 10:01:58 +08:00
|
|
|
base.*,
|
|
|
|
create_user.username as create_username,
|
|
|
|
update_user.username as update_username
|
|
|
|
from $tableName 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
|
2024-10-01 22:23:00 +08:00
|
|
|
<where>
|
2024-10-31 10:01:58 +08:00
|
|
|
base.is_deleted = 0
|
2024-10-10 16:58:31 +08:00
|
|
|
#foreach($field in $pageQueryMap)
|
|
|
|
<if test="dto.${field.property} != null and dto.${field.property} != ''">
|
2024-10-31 10:01:58 +08:00
|
|
|
and base.$field.column like CONCAT('%',#{dto.${field.property}},'%')
|
2024-10-10 16:58:31 +08:00
|
|
|
</if>
|
|
|
|
#end
|
2024-10-01 22:23:00 +08:00
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 物理删除${classTitle} -->
|
|
|
|
<delete id="deleteBatchIdsWithPhysics">
|
|
|
|
delete
|
2024-10-02 14:48:56 +08:00
|
|
|
from $tableName
|
2024-10-01 22:23:00 +08:00
|
|
|
where id in
|
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|