You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
163 lines
10 KiB
XML
163 lines
10 KiB
XML
<?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.ruoyi.portal.mapper.HwProductInfoMapper">
|
|
|
|
<resultMap type="HwProductInfo" id="HwProductInfoResult">
|
|
<result property="productInfoId" column="product_info_id" />
|
|
<result property="configTypeId" column="config_type_id" />
|
|
<result property="tabFlag" column="tab_flag" />
|
|
<result property="configModal" column="config_modal" />
|
|
<result property="productInfoEtitle" column="product_info_etitle" />
|
|
<result property="productInfoCtitle" column="product_info_ctitle" />
|
|
<result property="productInfoOrder" column="product_info_order" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="configTypeName" column="config_type_name" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="HwProductInfoHwProductInfoDetailResult" type="HwProductInfo" extends="HwProductInfoResult">
|
|
<collection property="hwProductInfoDetailList" notNullColumn="sub_product_info_detail_id" javaType="java.util.List" resultMap="HwProductInfoDetailResult" />
|
|
</resultMap>
|
|
|
|
<resultMap type="HwProductInfoDetail" id="HwProductInfoDetailResult">
|
|
<result property="productInfoDetailId" column="sub_product_info_detail_id" />
|
|
<result property="parentId" column="sub_parent_id" />
|
|
<result property="productInfoId" column="sub_product_info_id" />
|
|
<result property="productInfoDetailTitle" column="sub_product_info_detail_title" />
|
|
<result property="productInfoDetailDesc" column="sub_product_info_detail_desc" />
|
|
<result property="productInfoDetailOrder" column="sub_product_info_detail_order" />
|
|
<result property="productInfoDetailPic" column="sub_product_info_detail_pic" />
|
|
<result property="ancestors" column="sub_ancestors" />
|
|
<result property="createTime" column="sub_create_time" />
|
|
<result property="createBy" column="sub_create_by" />
|
|
<result property="updateTime" column="sub_update_time" />
|
|
<result property="updateBy" column="sub_update_by" />
|
|
<result property="configModel" column="config_model" />
|
|
</resultMap>
|
|
|
|
<sql id="selectHwProductInfoVo">
|
|
select product_info_id, config_type_id, tab_flag, config_modal, product_info_etitle, product_info_ctitle, product_info_order, create_time, create_by, update_time, update_by from hw_product_info
|
|
</sql>
|
|
|
|
<select id="selectHwProductInfoList" parameterType="HwProductInfo" resultMap="HwProductInfoResult">
|
|
<include refid="selectHwProductInfoVo"/>
|
|
<where>
|
|
<if test="configTypeId != null and configTypeId != ''"> and config_type_id = #{configTypeId}</if>
|
|
<if test="tabFlag != null and tabFlag != ''"> and tab_flag = #{tabFlag}</if>
|
|
<if test="configModal != null and configModal != ''"> and config_modal = #{configModal}</if>
|
|
<if test="productInfoEtitle != null "> and product_info_etitle like concat('%', #{productInfoEtitle}, '%')</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''"> and product_info_ctitle like concat('%', #{productInfoCtitle}, '%')</if>
|
|
<if test="productInfoOrder != null "> and product_info_order = #{productInfoOrder}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectHwProductInfoByProductInfoId" parameterType="Long" resultMap="HwProductInfoResult">
|
|
<include refid="selectHwProductInfoVo"/>
|
|
where product_info_id = #{productInfoId}
|
|
</select>
|
|
|
|
<insert id="insertHwProductInfo" parameterType="HwProductInfo" useGeneratedKeys="true" keyProperty="productInfoId">
|
|
insert into hw_product_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="configTypeId != null and configTypeId != ''">config_type_id,</if>
|
|
<if test="tabFlag != null and tabFlag != ''">tab_flag,</if>
|
|
<if test="configModal != null and configModal != ''">config_modal,</if>
|
|
<if test="productInfoEtitle != null">product_info_etitle,</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''">product_info_ctitle,</if>
|
|
<if test="productInfoOrder != null">product_info_order,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="configTypeId != null and configTypeId != ''">#{configTypeId},</if>
|
|
<if test="tabFlag != null and tabFlag != ''">#{tabFlag},</if>
|
|
<if test="configModal != null and configModal != ''">#{configModal},</if>
|
|
<if test="productInfoEtitle != null">#{productInfoEtitle},</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''">#{productInfoCtitle},</if>
|
|
<if test="productInfoOrder != null">#{productInfoOrder},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHwProductInfo" parameterType="HwProductInfo">
|
|
update hw_product_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="configTypeId != null and configTypeId != ''">config_type_id = #{configTypeId},</if>
|
|
<if test="tabFlag != null and tabFlag != ''">tab_flag = #{tabFlag},</if>
|
|
<if test="configModal != null and configModal != ''">config_modal = #{configModal},</if>
|
|
<if test="productInfoEtitle != null">product_info_etitle = #{productInfoEtitle},</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''">product_info_ctitle = #{productInfoCtitle},</if>
|
|
<if test="productInfoOrder != null">product_info_order = #{productInfoOrder},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
where product_info_id = #{productInfoId}
|
|
</update>
|
|
|
|
<delete id="deleteHwProductInfoByProductInfoId" parameterType="Long">
|
|
delete from hw_product_info where product_info_id = #{productInfoId}
|
|
</delete>
|
|
|
|
<delete id="deleteHwProductInfoByProductInfoIds" parameterType="String">
|
|
delete from hw_product_info where product_info_id in
|
|
<foreach item="productInfoId" collection="array" open="(" separator="," close=")">
|
|
#{productInfoId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectHwProductInfoJoinDetailList" parameterType="HwProductInfo" resultMap="HwProductInfoHwProductInfoDetailResult">
|
|
select a.product_info_id, a.config_type_id, a.tab_flag, a.config_modal, a.product_info_etitle, a.product_info_ctitle, a.product_info_order, a.create_time, a.create_by, a.update_time, a.update_by,
|
|
b.product_info_detail_id as sub_product_info_detail_id, b.parent_id as sub_parent_id, b.product_info_id as sub_product_info_id, b.product_info_detail_title as sub_product_info_detail_title, b.product_info_detail_desc as sub_product_info_detail_desc, b.product_info_detail_order as sub_product_info_detail_order, b.product_info_detail_pic as sub_product_info_detail_pic, b.ancestors as sub_ancestors, b.create_time as sub_create_time, b.create_by as sub_create_by, b.update_time as sub_update_time, b.update_by as sub_update_by,
|
|
b.config_modal AS config_model
|
|
from hw_product_info a
|
|
left join hw_product_info_detail b on b.product_info_id = a.product_info_id
|
|
<where>
|
|
<if test="configTypeId != null and configTypeId != ''"> and a.config_type_id = #{configTypeId}</if>
|
|
<if test="tabFlag != null and tabFlag != ''"> and a.tab_flag = #{tabFlag}</if>
|
|
<if test="configModal != null and configModal != ''"> and a.config_modal = #{configModal}</if>
|
|
<if test="productInfoEtitle != null "> and a.product_info_etitle = #{productInfoEtitle}</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''"> and a.product_info_ctitle = #{productInfoCtitle}</if>
|
|
<if test="productInfoOrder != null "> and a.product_info_order = #{productInfoOrder}</if>
|
|
<if test="parentId != null"> and b.parent_id = #{parentId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<sql id="selectHwProductInfoJoinVo">
|
|
select hpi.product_info_id, hpi.config_type_id, hpi.tab_flag, hpi.config_modal, hpi.product_info_etitle, hpi.product_info_ctitle, hpi.product_info_order,
|
|
hpi.create_time, hpi.create_by, hpi.update_time, hpi.update_by,hpct.config_type_name from hw_product_info hpi left join hw_portal_config_type hpct on hpi.config_type_id=hpct.config_type_id
|
|
</sql>
|
|
|
|
<select id="selectHwProductInfoJoinList" parameterType="HwProductInfo" resultMap="HwProductInfoResult">
|
|
<include refid="selectHwProductInfoJoinVo"/>
|
|
<where>
|
|
<if test="configTypeId != null and configTypeId != ''"> and hpi.config_type_id = #{configTypeId}</if>
|
|
<if test="tabFlag != null and tabFlag != ''"> and hpi.tab_flag = #{tabFlag}</if>
|
|
<if test="configModal != null and configModal != ''"> and hpi.config_modal = #{configModal}</if>
|
|
<if test="productInfoEtitle != null "> and hpi.product_info_etitle like concat('%', #{productInfoEtitle}, '%')</if>
|
|
<if test="productInfoCtitle != null and productInfoCtitle != ''"> and hpi.product_info_ctitle like concat('%', #{productInfoCtitle}, '%')</if>
|
|
<if test="productInfoOrder != null "> and hpi.product_info_order = #{productInfoOrder}</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper> |