|
@@ -0,0 +1,77 @@
|
|
|
|
+<?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.xs.core.mapper.task.TaskInfoMapper">
|
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.xs.core.model.task.entity.TaskInfo">
|
|
|
|
+ <id column="id" property="id"/>
|
|
|
|
+ <result column="name" property="name"/>
|
|
|
|
+ <result column="name_ja" property="nameJa"/>
|
|
|
|
+ <result column="name_ko" property="nameKo"/>
|
|
|
|
+ <result column="name_th" property="nameTh"/>
|
|
|
|
+ <result column="name_vi" property="nameVi"/>
|
|
|
|
+ <result column="name_ru" property="nameRu"/>
|
|
|
|
+ <result column="name_en" property="nameEn"/>
|
|
|
|
+ <result column="name_pt" property="namePt"/>
|
|
|
|
+ <result column="name_fa" property="nameFa"/>
|
|
|
|
+ <result column="name_es" property="nameEs"/>
|
|
|
|
+ <result column="instruction" property="instruction"/>
|
|
|
|
+ <result column="task_icon" property="taskIcon"/>
|
|
|
|
+ <result column="task_link" property="taskLink"/>
|
|
|
|
+ <result column="category_code" property="categoryCode"/>
|
|
|
|
+ <result column="status" property="status"/>
|
|
|
|
+ <result column="gold_coin" property="goldCoin"/>
|
|
|
|
+ <result column="sort_num" property="sortNum"/>
|
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
|
+ <result column="create_by" property="createBy"/>
|
|
|
|
+ <result column="update_by" property="updateBy"/>
|
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
|
+ <result column="updated_time" property="updatedTime"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <resultMap id="TaskInfoRespResultMap" type="com.xs.core.model.task.resp.TaskInfoResp">
|
|
|
|
+ <result column="id" property="id"/>
|
|
|
|
+ <result column="task_name" property="name"/>
|
|
|
|
+ <result column="instruction" property="instruction"/>
|
|
|
|
+ <result column="task_icon" property="taskIcon"/>
|
|
|
|
+ <result column="task_link" property="taskLink"/>
|
|
|
|
+ <result column="category_code" property="categoryCode"/>
|
|
|
|
+ <result column="gold_coin" property="goldCoin"/>
|
|
|
|
+ <result column="sort_num" property="sortNum"/>
|
|
|
|
+ <result column="user_task_status" property="userTaskStatus"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <select id="getTaskInfoList" resultMap="TaskInfoRespResultMap">
|
|
|
|
+ SELECT
|
|
|
|
+ ti.id,
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="userLang == 'ja'">ti.name_ja</when>
|
|
|
|
+ <when test="userLang == 'ko'">ti.name_ko</when>
|
|
|
|
+ <when test="userLang == 'th'">ti.name_th</when>
|
|
|
|
+ <when test="userLang == 'vi'">ti.name_vi</when>
|
|
|
|
+ <when test="userLang == 'ru'">ti.name_ru</when>
|
|
|
|
+ <when test="userLang == 'en'">ti.name_en</when>
|
|
|
|
+ <when test="userLang == 'pt'">ti.name_pt</when>
|
|
|
|
+ <when test="userLang == 'fa'">ti.name_fa</when>
|
|
|
|
+ <when test="userLang == 'es'">ti.name_es</when>
|
|
|
|
+ <otherwise>ti.name</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ AS task_name,
|
|
|
|
+ ti.instruction,
|
|
|
|
+ ti.task_icon,
|
|
|
|
+ ti.task_link,
|
|
|
|
+ ti.category_code,
|
|
|
|
+ ti.gold_coin,
|
|
|
|
+ ti.sort_num,
|
|
|
|
+ COALESCE(utr.status, 0) AS user_task_status
|
|
|
|
+ FROM
|
|
|
|
+ b_task_info ti
|
|
|
|
+ LEFT JOIN
|
|
|
|
+ b_user_task_record utr ON ti.id = utr.task_id AND utr.user_id = #{userId}
|
|
|
|
+ <where>
|
|
|
|
+ <if test="categoryCode != null and categoryCode != ''">
|
|
|
|
+ AND ti.category_code = #{categoryCode}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY ti.sort_num
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|