tenlion-module/module-building-pictures/src/main/resources/mybatis/mapper/picturestemplatearea/picturesmplatearea-mapper.xml

396 lines
16 KiB
XML
Raw Normal View History

2021-04-28 10:26:58 +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="cn.com.tenlion.buildingpictures.dao.picturestemplatearea.IPicturesTemplateAreaDao">
2021-05-28 17:21:43 +08:00
<resultMap id="picturesTemplateAreaDTO" type="cn.com.tenlion.materialstore.pojo.dtos.picturestemplatearea.PicturesTemplateAreaDTO">
2021-04-28 10:26:58 +08:00
<id column="pictures_template_area_id" property="picturesTemplateAreaId"/>
<result column="pictures_template_id" property="picturesTemplateId"/>
<result column="template_area_source" property="templateAreaSource"/>
<result column="template_area_left" property="templateAreaLeft"/>
<result column="template_area_top" property="templateAreaTop"/>
<result column="template_area_down" property="templateAreaDown"/>
<result column="template_area_right" property="templateAreaRight"/>
<result column="template_area_height" property="templateAreaHeight"/>
<result column="template_area_width" property="templateAreaWidth"/>
<result column="template_area_color" property="templateAreaColor"/>
<result column="template_area_remark" property="templateAreaRemark"/>
<result column="template_area_status" property="templateAreaStatus"/>
<result column="pictures_template_title" property="picturesTemplateTitle"/>
<result column="template_area_file" property="templateAreaFile"/>
<result column="template_area_server_link" property="templateAreaServerLink"/>
<result column="pictures_template_code" property="picturesTemplateCode"/>
2021-04-28 18:35:44 +08:00
<result column="template_area_font_center" property="templateAreaFontCenter"/>
<result column="template_area_font_size" property="templateAreaFontSize"/>
<result column="template_area_font_bold" property="templateAreaFontBold"/>
<result column="template_area_font_family" property="templateAreaFontFamily"/>
<result column="template_area_font_color" property="templateAreaFontColor"/>
<result column="template_area_font_value" property="templateAreaFontValue"/>
2021-04-28 10:26:58 +08:00
</resultMap>
2021-05-02 18:23:27 +08:00
<update id="updatePicturesTemplateAreaAll" parameterType="map">
UPDATE
m_pictures_template_area
SET
modifier = #{modifier},
<if test="templateAreaFontColor != null and templateAreaFontColor != ''">
template_area_font_color = #{templateAreaFontColor},
</if>
<if test="templateAreaFontFamily != null and templateAreaFontFamily != ''">
template_area_font_family = #{templateAreaFontFamily},
</if>
<if test="templateAreaFontBold != null and templateAreaFontBold != ''">
template_area_font_bold = #{templateAreaFontBold},
</if>
<if test="templateAreaFontSize != null and templateAreaFontSize != ''">
template_area_font_size = #{templateAreaFontSize},
</if>
<if test="templateAreaFontCenter != null and templateAreaFontCenter != ''">
template_area_font_center = #{templateAreaFontCenter},
</if>
gmt_modified = #{gmtModified}
WHERE
pictures_template_id = #{picturesTemplateId}
</update>
2021-04-28 10:26:58 +08:00
<!-- 修改展览模板区域配置 -->
<update id="updatePicturesTemplateAreaPointModuleData" parameterType="map">
UPDATE
2021-05-02 18:23:27 +08:00
m_pictures_template_area
2021-04-28 10:26:58 +08:00
SET
template_area_module_data = #{templateAreaModuleData},
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
pictures_template_area_id = #{picturesTemplateAreaId}
</update>
<!-- 修改展览模板区域 -->
<update id="updatePicturesTemplateAreaPoint" parameterType="map">
UPDATE
2021-05-02 18:23:27 +08:00
m_pictures_template_area
2021-04-28 10:26:58 +08:00
SET
template_area_left = #{templateAreaLeft},
template_area_top = #{templateAreaTop},
template_area_down = #{templateAreaDown},
template_area_right = #{templateAreaRight},
template_area_height = #{templateAreaHeight},
template_area_width = #{templateAreaWidth},
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
pictures_template_area_id = #{picturesTemplateAreaId}
</update>
2021-05-02 18:23:27 +08:00
<!-- 图片套版模板的区域设置详情 -->
<select id="getPicturesTemplateAreaByPicturesTemplateCode" parameterType="java.lang.String" resultMap="picturesTemplateAreaDTO">
SELECT
t1.pictures_template_area_id,
t1.pictures_template_id,
t1.template_area_source,
t1.template_area_color,
t1.template_area_remark,
t1.template_area_status,
t1.template_area_left,
t1.template_area_top,
t1.template_area_down,
t1.template_area_right,
t1.template_area_height,
t1.template_area_width,
t1.template_area_file,
t1.template_area_server_link,
t1.template_area_font_center,
t1.template_area_font_size,
t1.template_area_font_bold,
t1.template_area_font_family,
t1.template_area_font_color,
t1.template_area_font_value,
t2.pictures_template_code
FROM
m_pictures_template_area t1
LEFT JOIN
m_pictures_template t2
ON
t1.pictures_template_id = t2.pictures_template_id
WHERE
t1.is_delete = 0 AND t2.pictures_template_code = #{picturesTemplateCode}
ORDER BY t1.gmt_create
</select>
2021-04-28 10:26:58 +08:00
<!-- 图片套版模板的区域设置详情 -->
<select id="getPicturesTemplateAreaByPicturesTemplateId" parameterType="map" resultMap="picturesTemplateAreaDTO">
SELECT
t1.pictures_template_area_id,
t1.pictures_template_id,
t1.template_area_source,
t1.template_area_color,
t1.template_area_remark,
t1.template_area_status,
t1.template_area_left,
t1.template_area_top,
t1.template_area_down,
t1.template_area_right,
t1.template_area_height,
t1.template_area_width,
t1.template_area_file,
2021-04-28 18:35:44 +08:00
t1.template_area_server_link,
t1.template_area_font_center,
t1.template_area_font_size,
t1.template_area_font_bold,
t1.template_area_font_family,
t1.template_area_font_color,
t1.template_area_font_value
2021-04-28 10:26:58 +08:00
FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area t1
2021-04-28 10:26:58 +08:00
WHERE
t1.is_delete = 0
<if test="picturesTemplateId != null and picturesTemplateId != ''">
AND
t1.pictures_template_id = #{picturesTemplateId}
</if>
2021-04-28 18:35:44 +08:00
<if test="templateAreaSource != null and templateAreaSource != ''">
AND
t1.template_area_source = #{templateAreaSource}
</if>
2021-04-28 10:26:58 +08:00
ORDER BY t1.gmt_create
</select>
<!-- 新增图片套版模板的区域设置 -->
<insert id="savePicturesTemplateArea" parameterType="map">
2021-05-02 18:23:27 +08:00
INSERT INTO m_pictures_template_area(
2021-04-28 10:26:58 +08:00
pictures_template_area_id,
pictures_template_id,
template_area_source,
template_area_left,
template_area_top,
template_area_down,
template_area_right,
template_area_height,
template_area_width,
template_area_color,
template_area_remark,
template_area_status,
template_area_file,
template_area_server_link,
2021-04-28 18:35:44 +08:00
template_area_font_center,
template_area_font_size,
template_area_font_bold,
template_area_font_family,
template_area_font_color,
template_area_font_value,
2021-04-28 10:26:58 +08:00
creator,
gmt_create,
modifier,
gmt_modified,
is_delete
) VALUES(
#{picturesTemplateAreaId},
#{picturesTemplateId},
#{templateAreaSource},
#{templateAreaLeft},
#{templateAreaTop},
#{templateAreaDown},
#{templateAreaRight},
#{templateAreaHeight},
#{templateAreaWidth},
#{templateAreaColor},
#{templateAreaRemark},
#{templateAreaStatus},
#{templateAreaFile},
#{templateAreaServerLink},
2021-04-28 18:35:44 +08:00
#{templateAreaFontCenter},
#{templateAreaFontSize},
#{templateAreaFontBold},
#{templateAreaFontFamily},
#{templateAreaFontColor},
#{templateAreaFontValue},
2021-04-28 10:26:58 +08:00
#{creator},
#{gmtCreate},
#{modifier},
#{gmtModified},
#{isDelete}
)
</insert>
<!-- 删除图片套版模板的区域设置 -->
<update id="removePicturesTemplateArea" parameterType="map">
UPDATE
2021-05-02 18:23:27 +08:00
m_pictures_template_area
2021-04-28 10:26:58 +08:00
SET
is_delete = 1,
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
pictures_template_area_id IN
<foreach collection="picturesTemplateAreaIds" index="index" open="(" separator="," close=")">
#{picturesTemplateAreaIds[${index}]}
</foreach>
</update>
<!-- 删除图片套版模板的区域设置(物理) -->
<update id="deletePicturesTemplateArea" parameterType="map">
DELETE FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area
2021-04-28 10:26:58 +08:00
WHERE
pictures_template_area_id IN
<foreach collection="picturesTemplateAreaIds" index="index" open="(" separator="," close=")">
#{picturesTemplateAreaIds[${index}]}
</foreach>
</update>
<!-- 修改图片套版模板的区域设置 -->
<update id="updatePicturesTemplateArea" parameterType="map">
UPDATE
2021-05-02 18:23:27 +08:00
m_pictures_template_area
2021-04-28 10:26:58 +08:00
SET
<if test="templateAreaColor != null and templateAreaColor != ''">
template_area_color = #{templateAreaColor},
</if>
<if test="templateAreaSource != null and templateAreaSource != ''">
template_area_source = #{templateAreaSource},
</if>
2021-04-28 18:35:44 +08:00
<if test="templateAreaFontCenter != null and templateAreaFontCenter != ''">
template_area_font_center = #{templateAreaFontCenter},
</if>
<if test="templateAreaFontSize != null and templateAreaFontSize != ''">
template_area_font_size = #{templateAreaFontSize},
</if>
<if test="templateAreaFontBold != null and templateAreaFontBold != ''">
template_area_font_bold = #{templateAreaFontBold},
</if>
<if test="templateAreaFontFamily != null and templateAreaFontFamily != ''">
template_area_font_family = #{templateAreaFontFamily},
</if>
<if test="templateAreaFontColor != null and templateAreaFontColor != ''">
template_area_font_color = #{templateAreaFontColor},
</if>
<if test="templateAreaFontValue != null and templateAreaFontValue != ''">
template_area_font_value = #{templateAreaFontValue},
2021-04-28 10:26:58 +08:00
</if>
2021-05-02 18:23:27 +08:00
template_area_remark = #{templateAreaRemark},
2021-04-28 10:26:58 +08:00
template_area_file = #{templateAreaFile},
template_area_server_link = #{templateAreaServerLink},
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
pictures_template_area_id = #{picturesTemplateAreaId}
</update>
<select id="getPicturesTemplateIdGroupByPicturesModuleId" parameterType="map" resultMap="picturesTemplateAreaDTO">
SELECT
2021-04-28 18:35:44 +08:00
t1.pictures_template_id,
t1.template_area_source,
t1.template_area_color,
t1.template_area_remark,
t1.template_area_status,
t1.pictures_template_area_id,
t3.pictures_template_title,
t3.pictures_template_code,
t1.template_area_file,
t1.template_area_server_link,
t1.template_area_font_center,
t1.template_area_font_size,
t1.template_area_font_bold,
t1.template_area_font_family,
t1.template_area_font_color,
t1.template_area_font_value
2021-04-28 10:26:58 +08:00
FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area t1
2021-04-28 10:26:58 +08:00
LEFT JOIN
2021-05-02 18:23:27 +08:00
m_pictures_template t3
2021-04-28 10:26:58 +08:00
ON
t1.pictures_template_id = t3.pictures_template_id
WHERE
t1.is_delete = 0 AND t1.pictures_module_id = #{picturesModuleId}
GROUP BY t1.pictures_template_id
</select>
<!-- 图片套版模板的区域设置详情 -->
<select id="getPicturesTemplateArea" parameterType="map" resultMap="picturesTemplateAreaDTO">
SELECT
t1.pictures_template_id,
t1.template_area_source,
t1.template_area_color,
t1.template_area_remark,
t1.template_area_status,
t1.pictures_template_area_id,
t3.pictures_template_title,
t1.template_area_file,
2021-04-28 18:35:44 +08:00
t1.template_area_server_link,
t1.template_area_font_center,
t1.template_area_font_size,
t1.template_area_font_bold,
t1.template_area_font_family,
t1.template_area_font_color,
t1.template_area_font_value
2021-04-28 10:26:58 +08:00
FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area t1
2021-04-28 10:26:58 +08:00
LEFT JOIN
2021-05-02 18:23:27 +08:00
m_pictures_template t3
2021-04-28 10:26:58 +08:00
ON
t1.pictures_template_id = t3.pictures_template_id
WHERE
t1.is_delete = 0
<if test="picturesTemplateAreaId != null and picturesTemplateAreaId != ''">
AND
t1.pictures_template_area_id = #{picturesTemplateAreaId}
</if>
</select>
<!-- 图片套版模板的区域设置列表 -->
<select id="listPicturesTemplateArea" parameterType="map" resultMap="picturesTemplateAreaDTO">
SELECT
t1.pictures_template_id,
t1.template_area_source,
t1.template_area_color,
t1.template_area_remark,
t1.template_area_status,
t1.pictures_template_area_id,
t1.template_area_file,
2021-04-28 18:35:44 +08:00
t1.template_area_server_link,
t1.template_area_font_center,
t1.template_area_font_size,
t1.template_area_font_bold,
t1.template_area_font_family,
t1.template_area_font_color,
t1.template_area_font_value
2021-04-28 10:26:58 +08:00
FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area t1
2021-04-28 10:26:58 +08:00
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')
OR
t1.pictures_template_area_id LIKE CONCAT('%', #{keywords}, '%')
<!-- 这里添加其他条件 -->
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="picturesTemplateAreaIds != null and picturesTemplateAreaIds.size > 0">
AND
t1.pictures_template_area_id IN
<foreach collection="picturesTemplateAreaIds" index="index" open="(" separator="," close=")">
#{picturesTemplateAreaIds[${index}]}
</foreach>
</if>
</select>
<!-- 图片套版模板的区域设置统计 -->
<select id="countPicturesTemplateArea" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
2021-05-02 18:23:27 +08:00
m_pictures_template_area t1
2021-04-28 10:26:58 +08:00
WHERE
t1.is_delete = 0
</select>
</mapper>