<?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>
|