2024-02-20 10:12:44 +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">
|
|
|
|
|
<mapper namespace="com.ai.da.mapper.secondary.AttributeRetrievalMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.ai.da.mapper.secondary.entity.AttributeRetrieval">
|
|
|
|
|
<id column="ID" property="id" />
|
|
|
|
|
<result column="img_name" property="imgName" />
|
|
|
|
|
<result column="length" property="length" />
|
|
|
|
|
<result column="sleeve_length" property="sleeveLength" />
|
|
|
|
|
<result column="sleeve_shape" property="sleeveShape" />
|
|
|
|
|
<result column="sleeve_shoulder" property="sleeveShoulder" />
|
|
|
|
|
<result column="neckline" property="neckline" />
|
|
|
|
|
<result column="collar" property="collar" />
|
|
|
|
|
<result column="design" property="design" />
|
|
|
|
|
<result column="silhouette" property="silhouette" />
|
|
|
|
|
<result column="type" property="type" />
|
|
|
|
|
<result column="opening_type" property="openingType" />
|
|
|
|
|
<result column="subtype" property="subtype" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="getSystemSketchPool" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
${tableName}
|
|
|
|
|
<trim prefix="WHERE" prefixOverrides="AND">
|
|
|
|
|
<if test="attributeRetrievalAttrDict.design != null">
|
|
|
|
|
AND design = #{attributeRetrievalAttrDict.design}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="attributeRetrievalAttrDict.silhouette != null">
|
|
|
|
|
AND silhouette = #{attributeRetrievalAttrDict.silhouette}
|
|
|
|
|
</if>
|
2024-06-27 15:33:26 +08:00
|
|
|
<if test="style != null">
|
|
|
|
|
AND style = #{style}
|
|
|
|
|
</if>
|
2024-10-04 10:40:32 +08:00
|
|
|
AND deprecated = 0
|
2024-02-20 10:12:44 +08:00
|
|
|
</trim>
|
|
|
|
|
ORDER BY
|
|
|
|
|
RAND()
|
|
|
|
|
LIMIT #{poolNum}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSystemRandom" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
${tableName}
|
2024-06-27 15:33:26 +08:00
|
|
|
<trim prefix="WHERE" prefixOverrides="AND">
|
|
|
|
|
<if test="style != null">
|
|
|
|
|
AND style = #{style}
|
|
|
|
|
</if>
|
2024-10-04 10:40:32 +08:00
|
|
|
AND deprecated = 0
|
2024-06-27 15:33:26 +08:00
|
|
|
</trim>
|
2024-02-20 10:12:44 +08:00
|
|
|
ORDER BY
|
|
|
|
|
RAND()
|
|
|
|
|
LIMIT 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSystemSketchPoolBySameCategory" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
${tableName}
|
|
|
|
|
<trim prefix="WHERE" prefixOverrides="AND">
|
|
|
|
|
<if test="attributeRetrievalAttrDict.type != null">
|
|
|
|
|
AND type = #{attributeRetrievalAttrDict.type}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="attributeRetrievalAttrDict.openingType != null">
|
|
|
|
|
AND opening_type = #{attributeRetrievalAttrDict.openingType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="attributeRetrievalAttrDict.subtype != null">
|
|
|
|
|
AND subtype = #{attributeRetrievalAttrDict.subtype}
|
|
|
|
|
</if>
|
2024-06-27 15:33:26 +08:00
|
|
|
<if test="style != null">
|
|
|
|
|
AND style = #{style}
|
|
|
|
|
</if>
|
2024-10-04 10:40:32 +08:00
|
|
|
AND deprecated = 0
|
2024-02-20 10:12:44 +08:00
|
|
|
</trim>
|
|
|
|
|
ORDER BY
|
|
|
|
|
RAND()
|
|
|
|
|
LIMIT 20
|
|
|
|
|
</select>
|
2024-06-25 10:59:58 +08:00
|
|
|
|
|
|
|
|
<select id="getIdByFileName" resultType="java.lang.Long">
|
|
|
|
|
SELECT
|
|
|
|
|
ID
|
|
|
|
|
FROM
|
|
|
|
|
${tableName}
|
|
|
|
|
WHERE img_name = #{fileName}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateStyleById">
|
|
|
|
|
update ${tableName}
|
|
|
|
|
set style = #{style}
|
|
|
|
|
where ID = #{id}
|
|
|
|
|
</update>
|
2024-06-27 15:33:26 +08:00
|
|
|
|
|
|
|
|
<update id="updateStyleByFileName">
|
|
|
|
|
UPDATE
|
|
|
|
|
${tableName}
|
|
|
|
|
SET
|
|
|
|
|
style = #{style}
|
|
|
|
|
WHERE
|
2024-10-04 10:40:32 +08:00
|
|
|
img_name = #{fileName}
|
2024-06-27 15:33:26 +08:00
|
|
|
</update>
|
2024-02-20 10:12:44 +08:00
|
|
|
</mapper>
|