无关风月
2024-08-20 f237a61c412870933f47316a011237cd538de9bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?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.stylefeng.guns.modular.system.dao.FitnessPositionMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.FitnessPosition">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="typeId" property="typeId" />
        <result column="amount" property="amount" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, typeId, amount
    </sql>
    <select id="fitnessPosition" resultType="com.stylefeng.guns.modular.system.vo.FitnessPositionVO">
        select t1.*,t2.name as typeName,t2.id as typeId
        from t_fitness_position t1
        left join t_fitness_type t2 on t1.typeId = t2.id
        where 1=1
        <if test="req.typeId!=null">
            and t1.typeId = #{req.typeId}
        </if>
        <if test="req.name!=null and req.name!= ''">
            AND t1.name LIKE concat('%',#{req.name},'%')
        </if>
        and t1.isDelete = 0
        order by t1.id desc
    </select>
 
</mapper>