mx_datav_gs/mxdata_v-system/target/classes/mybatis/business/MxComponentsMapper.xml

145 lines
6.1 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.alonginfo.project.business.mapper.MxComponentsMapper">
<!--映射关系-->
<resultMap type="MxComponentsType" id="MxComponentsTypeResult">
<result property="comTypeId" column="com_type_id" />
<result property="comTypeName" column="com_type_name" />
<result property="remark" column="remark" />
<result property="createDate" column="create_date" />
</resultMap>
<resultMap type="MxComponents" id="MxComponentsResult">
<result property="comId" column="com_id" />
<result property="comTypeId" column="com_type_id" />
<result property="comName" column="com_name" />
<result property="comAliasName" column="com_alias_name" />
<result property="remark" column="remark"/>
<result property="enabled" column="enabled" />
<result property="comPngUrl" column="com_png_url" />
<result property="createDate" column="create_date" />
</resultMap>
<sql id="selectMxComponentsTypeVo">
select com_type_id,com_type_name,remark,create_date
from mx_components_type
</sql>
<sql id="selectMxComponentsVo">
select com_id,com_type_id,com_name,com_alias_name,remark,enabled,com_png_url,create_date
from mx_components
</sql>
<!-- 新增 组件类型 -->
<insert id="insertMxComponentsType" parameterType="MxComponentsType" >
insert into mx_components_type(
<if test="comTypeId != null and comTypeId != ''">com_type_id,</if>
<if test="comTypeName != null and comTypeName != ''">com_type_name,</if>
<if test="remark != null and remark != ''">remark,</if>
create_date
)
values(
<if test="comTypeId != null and comTypeId != ''">#{comTypeId},</if>
<if test="comTypeName != null and comTypeName != ''">#{comTypeName},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<!-- 删除 组件类型 -->
<delete id="deleteMxComponentsType" >
delete from mx_components_type where com_type_id = #{comTypeId}
</delete>
<!--修改 组件类型 -->
<update id="editMxComponentsType" parameterType="MxComponentsType">
update mx_components_type
<set>
<if test="comTypeName != null and comTypeName != ''">com_type_name = #{comTypeName},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
create_date = sysdate()
</set>
where com_type_id = #{comTypeId}
</update>
<!--查询 组件类型 -->
<select id="getMxComponentsType" resultMap="MxComponentsTypeResult">
<include refid="selectMxComponentsTypeVo"/>
where com_type_id = #{comTypeId}
</select>
<!--查询 组件类型list -->
<select id="listMxComponentsType" resultMap="MxComponentsTypeResult">
<include refid="selectMxComponentsTypeVo"/>
order by create_date
</select>
<!-- 新增 组件 -->
<insert id="insertMxComponents" parameterType="MxComponents" >
insert into mx_components(
<if test="comId != null and comId != ''">com_id,</if>
<if test="comTypeId != null and comTypeId != ''">com_type_id,</if>
<if test="comName != null and comName != ''">com_name,</if>
<if test="comAliasName != null and comAliasName != ''">com_alias_name,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="enabled != null and enabled != ''">enabled,</if>
<if test="comPngUrl != null and comPngUrl != ''">com_png_url,</if>
create_date
)
values(
<if test="comId != null and comId != ''">#{comId},</if>
<if test="comTypeId != null and comTypeId != ''">#{comTypeId},</if>
<if test="comName != null and comName != ''">#{comName},</if>
<if test="comAliasName != null and comAliasName != ''">#{comAliasName},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="enabled != null and enabled != ''">#{enabled},</if>
<if test="comPngUrl != null and comPngUrl != ''">#{comPngUrl},</if>
sysdate()
)
</insert>
<!-- 删除 组件类型 -->
<delete id="deleteMxComponents" >
delete from mx_components where com_id = #{comId}
</delete>
<!-- 删除 组件类型 根据组件类型 -->
<delete id="deleteMxComponentsByComTypeId" >
delete from mx_components where com_type_id = #{comTypeId}
</delete>
<!--修改 组件 -->
<update id="editMxComponents" parameterType="MxComponents">
update mx_components
<set>
<if test="comTypeId != null and comTypeId != ''">com_type_id = #{comTypeId},</if>
<if test="comName != null and comName != ''">com_name = #{comName},</if>
<if test="comAliasName != null and comAliasName != ''">com_alias_name = #{comAliasName},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="enabled != null and enabled != ''">enabled = #{enabled},</if>
<if test="comPngUrl != null and comPngUrl != ''">com_png_url = #{comPngUrl},</if>
create_date = sysdate()
</set>
where com_id = #{comId}
</update>
<!--查询 组件 根据id -->
<select id="getMxComponents" resultMap="MxComponentsResult">
<include refid="selectMxComponentsVo"/>
where com_id = #{comId}
</select>
<!--查询 组件list 根据组件类型id -->
<select id="getMxComponentsBycomId" resultMap="MxComponentsResult">
<include refid="selectMxComponentsVo"/>
where com_type_id = #{comTypeId} and enabled = '1'
order by create_date
</select>
<!-- 查询所有有效的组件-->
<select id="getAllCompinfo" resultMap="MxComponentsResult">
<include refid="selectMxComponentsVo"/>
where enabled = '1'
</select>
</mapper>