|
|
|
<?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.epmet.dao.FunctionCustomizedDao">
|
|
|
|
<!-- 定制功能详情查询 -->
|
|
|
|
<select id="getFunctionCustomizedByFunctionId" parameterType="com.epmet.dto.form.CommonFunctionIdFormDTO"
|
|
|
|
resultType="com.epmet.dto.result.FunctionCustomizedDetailResultDTO">
|
|
|
|
SELECT
|
|
|
|
cu.FUNCTION_ID functionId,
|
|
|
|
f.SHOPPING_STATUS shoppingStatus,
|
|
|
|
f.FUNCTION_EXPLAIN functionExplain,
|
|
|
|
cu.CUSTOMIZED_NAME customizedName,
|
|
|
|
cu.ICON_LARGE_IMG iconLargeImg,
|
|
|
|
cu.ICON_SMALL_IMG iconSmallImg,
|
|
|
|
cu.TARGET_LINK targetLink,
|
|
|
|
cu.DOMAIN_NAME domainName,
|
|
|
|
cu.FROM_APP fromApp
|
|
|
|
FROM function_customized cu
|
|
|
|
LEFT JOIN `function` f ON cu.FUNCTION_ID = f.ID
|
|
|
|
WHERE cu.DEL_FLAG = '0'
|
|
|
|
AND cu.FUNCTION_ID = #{functionId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="delByFunctionId" parameterType="String">
|
|
|
|
update function_customized set DEL_FLAG = 1 where FUNCTION_ID = #{functionId} and DEL_FLAG = '0'
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 根据功能id,查询定制功能全部信息(定制功能表+功能表) -->
|
|
|
|
<select id="selectCustomized" parameterType="String"
|
|
|
|
resultType="com.epmet.dto.CustomizedDTO">
|
|
|
|
SELECT
|
|
|
|
f.ID functionId,
|
|
|
|
f.SHOPPING_STATUS shoppingStatus,
|
|
|
|
f.FUNCTION_EXPLAIN functionExplain,
|
|
|
|
cu.ID customizedId,
|
|
|
|
cu.CUSTOMIZED_NAME customizedName,
|
|
|
|
cu.ICON_LARGE_IMG iconLargeImg,
|
|
|
|
cu.ICON_SMALL_IMG iconSmallImg,
|
|
|
|
cu.TARGET_LINK targetLink,
|
|
|
|
cu.DOMAIN_NAME domainName,
|
|
|
|
cu.FROM_APP fromApp
|
|
|
|
FROM `function` f
|
|
|
|
LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
|
|
|
|
WHERE f.DEL_FLAG = '0'
|
|
|
|
AND f.ID = #{functionId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 定制功能列表 -->
|
|
|
|
<select id="selectListFunctionCustomizedList" parameterType="com.epmet.dto.form.FunctionCustomizedListFormDTO"
|
|
|
|
resultType="com.epmet.dto.result.FunctionCustomizedListDTO">
|
|
|
|
SELECT
|
|
|
|
f.ID functionId,
|
|
|
|
f.SHOPPING_STATUS shoppingStatus,
|
|
|
|
f.FUNCTION_EXPLAIN functionExplain,
|
|
|
|
cu.CUSTOMIZED_NAME customizedName,
|
|
|
|
cu.ICON_LARGE_IMG iconLargeImg,
|
|
|
|
cu.ICON_SMALL_IMG iconSmallImg,
|
|
|
|
cu.TARGET_LINK targetLink,
|
|
|
|
cu.DOMAIN_NAME domainName,
|
|
|
|
cu.FROM_APP fromApp
|
|
|
|
FROM `function` f
|
|
|
|
LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
|
|
|
|
WHERE f.DEL_FLAG = '0'
|
|
|
|
AND cu.DEL_FLAG = '0'
|
|
|
|
<if test="customizedName != null and customizedName.trim() != ''">
|
|
|
|
AND cu.CUSTOMIZED_NAME = #{customizedName}
|
|
|
|
</if>
|
|
|
|
<if test="fromApp != null and fromApp.trim() != ''">
|
|
|
|
AND cu.FROM_APP = 'gov'
|
|
|
|
</if>
|
|
|
|
ORDER BY cu.FROM_APP, f.CREATED_TIME DESC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 定制功能列表 总条数 -->
|
|
|
|
<select id="countTotalFunctionCustomizedList" parameterType="com.epmet.dto.form.FunctionCustomizedListFormDTO"
|
|
|
|
resultType="INT">
|
|
|
|
SELECT
|
|
|
|
count(1)
|
|
|
|
FROM `function` f
|
|
|
|
LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
|
|
|
|
WHERE f.DEL_FLAG = '0'
|
|
|
|
AND cu.DEL_FLAG = '0'
|
|
|
|
<if test="customizedName != null and customizedName.trim() != ''">
|
|
|
|
AND cu.CUSTOMIZED_NAME = #{customizedName}
|
|
|
|
</if>
|
|
|
|
<if test="fromApp != null and fromApp.trim() != ''">
|
|
|
|
AND cu.FROM_APP = 'gov'
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateFunctionCustomized" parameterType="com.epmet.entity.FunctionCustomizedEntity">
|
|
|
|
UPDATE function_customized
|
|
|
|
SET
|
|
|
|
<if test="customizedName != null and customizedName.trim() != ''">
|
|
|
|
CUSTOMIZED_NAME = #{customizedName},
|
|
|
|
</if>
|
|
|
|
<if test="iconLargeImg != null and iconLargeImg.trim() != ''">
|
|
|
|
ICON_LARGE_IMG = #{iconLargeImg},
|
|
|
|
</if>
|
|
|
|
<if test="iconSmallImg != null and iconSmallImg.trim() != ''">
|
|
|
|
ICON_SMALL_IMG = #{iconSmallImg},
|
|
|
|
</if>
|
|
|
|
<if test="targetLink != null and targetLink.trim() != ''">
|
|
|
|
TARGET_LINK = #{targetLink},
|
|
|
|
</if>
|
|
|
|
<if test="domainName != null and domainName.trim() != ''">
|
|
|
|
DOMAIN_NAME = #{domainName},
|
|
|
|
</if>
|
|
|
|
<if test="fromApp != null and fromApp.trim() != ''">
|
|
|
|
FROM_APP = #{fromApp},
|
|
|
|
</if>
|
|
|
|
UPDATED_TIME = now()
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND FUNCTION_ID = #{functionId}
|
|
|
|
</update>
|
|
|
|
</mapper>
|