1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?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.backendsys.modules.crt.dao.CrtLoraStyleDao">
- <sql id="includeCrtLoraStyle">
- s.id,
- s.category_id,
- COALESCE(sc.category_name, '') category_name,
- s.name,
- COALESCE(s.thumb, '') thumb,
- s.lora_style_name,
- s.lora_style_path
- </sql>
- <resultMap id="resultMapCrtLoraStyle" type="java.util.LinkedHashMap">
- <id property="id" column="id" jdbcType="BIGINT" />
- <result property="category_id" column="category_id" javaType="java.lang.Long" />
- <result property="category_name" column="category_name" />
- <result property="name" column="name" />
- <result property="thumb" column="thumb" />
- <result property="lora_style_name" column="lora_style_name" />
- <result property="lora_style_path" column="lora_style_path" />
- </resultMap>
- <!-- 查 列表 -->
- <select id="selectCrtLoraStyleList" resultMap="resultMapCrtLoraStyle">
- SELECT
- <include refid="includeCrtLoraStyle" />
- FROM crt_lora_style s
- LEFT JOIN crt_lora_style_category sc ON s.category_id = sc.id
- <where>
- <if test="category_id != null and category_id != ''">
- AND s.category_id = #{category_id}
- </if>
- <if test="name != null and name != ''">
- AND s.name LIKE CONCAT('%', #{name}, '%')
- </if>
- </where>
- </select>
- </mapper>
|