|
|
|
<?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.supervision.mapper.AskTemplateQuestionLibraryMapper">
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.supervision.model.AskTemplateQuestionLibrary">
|
|
|
|
<id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="dictId" column="dict_id" jdbcType="BIGINT"/>
|
|
|
|
<result property="code" column="code" jdbcType="VARCHAR"/>
|
|
|
|
<result property="description" column="description" jdbcType="VARCHAR"/>
|
|
|
|
<result property="question" column="question" jdbcType="ARRAY"
|
|
|
|
typeHandler="com.supervision.handler.StringListTypeHandler"/>
|
|
|
|
<result property="defaultAnswer" column="default_answer" jdbcType="VARCHAR"/>
|
|
|
|
<result property="defaultAnswerCode" column="default_answer_code" jdbcType="VARCHAR"/>
|
|
|
|
<result property="defaultAnswerResourceId" column="default_answer_resources_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id
|
|
|
|
,dict_id,code,description,
|
|
|
|
question,default_answer,default_answer_code,default_answer_resources_id,create_user_id,
|
|
|
|
create_time,update_user_id,update_time
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="askQuestionLibraryResultMap" type="com.supervision.vo.manage.AskQuestionLibraryResVo">
|
|
|
|
<id property="id" column="id" />
|
|
|
|
<result property="code" column="code" />
|
|
|
|
<result property="code" column="code" />
|
|
|
|
<result property="dictId" column="dictId" />
|
|
|
|
<result property="libraryQuestionId" column="libraryQuestionId" />
|
|
|
|
<result property="question" column="question" typeHandler="com.supervision.handler.StringListTypeHandler" />
|
|
|
|
<result property="nameZhPath" column="nameZhPath" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="queryListsql">
|
|
|
|
select
|
|
|
|
atql.id as id,
|
|
|
|
atql.default_answer,
|
|
|
|
atql.id as libraryQuestionId,
|
|
|
|
cd.code as code,
|
|
|
|
atql.dict_id as dictId,
|
|
|
|
atql.question as question,
|
|
|
|
cd.name_zh_path as nameZhPath,
|
|
|
|
cd.name_zh as nameZh
|
|
|
|
from vp_ask_template_question_library atql
|
|
|
|
left join vp_common_dic cd on atql.dict_id = cd.id
|
|
|
|
<where>
|
|
|
|
<if test="askQuestionLibrary.code != null and askQuestionLibrary.code != '' ">
|
|
|
|
cd.code = #{askQuestionLibrary.code}
|
|
|
|
</if>
|
|
|
|
<if test="askQuestionLibrary.question != null and askQuestionLibrary.question != '' ">
|
|
|
|
JSON_EXTRACT(question, '$[*]') like CONCAT('%', #{askQuestionLibrary.question}, '%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="queryList" resultMap="askQuestionLibraryResultMap" parameterType="com.supervision.vo.manage.AskQuestionLibraryReqVo">
|
|
|
|
<include refid="queryListsql"></include>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="queryPageList" resultMap="askQuestionLibraryResultMap" resultType="com.supervision.vo.manage.AskQuestionLibraryResVo">
|
|
|
|
<include refid="queryListsql"></include>
|
|
|
|
</select>
|
|
|
|
</mapper>
|