<?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="cn.lili.modules.lmk.mapper.GoodsCustomizeTemplateMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.GoodsCustomizeTemplateVO">
|
<id column="id" property="id"/>
|
<result column="template_name" property="templateName" />
|
<result column="status" property="status" />
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="getById" resultMap="BaseResultMap">
|
SELECT
|
LGCT.template_name,
|
LGCT.status,
|
LGCT.id
|
FROM
|
lmk_goods_customize_template LGCT
|
WHERE
|
LGCT.id = #{id} AND LGCT.delete_flag = 0
|
</select>
|
|
|
<select id="getPage" resultMap="BaseResultMap">
|
SELECT
|
LGCT.template_name,
|
LGCT.status,
|
LGCT.id
|
FROM
|
lmk_goods_customize_template LGCT
|
WHERE
|
LGCT.delete_flag = 0
|
</select>
|
<resultMap id="getCustomizeTemplateMap" type="cn.lili.modules.lmk.domain.vo.CustomizeTemplateVO">
|
<id property="id" column="id"/>
|
<result property="name" column="template_name"/>
|
<collection property="templateImgs" ofType="cn.lili.modules.lmk.domain.entity.TemplateImgs">
|
<id property="id" column="imgId"/>
|
<result property="imgUrl" column="img_url"/>
|
</collection>
|
<collection property="templateConstomizeTitles" ofType="cn.lili.modules.lmk.domain.entity.TemplateConstomizeTitle">
|
<id property="id" column="titleId"/>
|
<result property="contentType" column="content_type"/>
|
<result property="templateTitle" column="template_title"/>
|
</collection>
|
</resultMap>
|
<select id="getCustomizeTemplate" resultMap="getCustomizeTemplateMap">
|
SELECT
|
lgct.id,
|
lgct.template_name,
|
lti.id imgId,
|
lti.img_url,
|
ltct.id titleId,
|
ltct.template_title,
|
ltct.content_type
|
FROM
|
lmk_goods_customize_template lgct
|
JOIN lmk_template_imgs lti ON lti.template_id = lgct.id
|
JOIN lmk_template_constomize_title ltct ON ltct.template_id = lgct.id
|
WHERE
|
lgct.id = #{id}
|
AND lgct.delete_flag = 0
|
AND lti.delete_flag = 0
|
AND ltct.delete_flag = 0
|
</select>
|
|
</mapper>
|