82 lines
3.8 KiB
XML
82 lines
3.8 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.xinda.iot.mapper.UnitIconMapper">
|
|
|
|
<resultMap type="UnitIcon" id="UnitIconResult">
|
|
<result property="id" column="id" />
|
|
<result property="unitDesc" column="unit_desc" />
|
|
<result property="unitName" column="unit_name" />
|
|
<result property="resourceUrl" column="resource_url" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectUnitIconVo">
|
|
select id, unit_desc, unit_name, resource_url, create_by, create_time, update_by, update_time from iot_unit_icon
|
|
</sql>
|
|
|
|
<select id="selectUnitIconList" parameterType="UnitIcon" resultMap="UnitIconResult">
|
|
<include refid="selectUnitIconVo"/>
|
|
<where>
|
|
<if test="unitDesc != null and unitDesc != ''"> and unit_desc like concat('%', #{unitDesc}, '%')</if>
|
|
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
|
|
<if test="resourceUrl != null and resourceUrl != ''"> and resource_url = #{resourceUrl}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectUnitIconById" parameterType="Long" resultMap="UnitIconResult">
|
|
<include refid="selectUnitIconVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertUnitIcon" parameterType="UnitIcon" useGeneratedKeys="true" keyProperty="id">
|
|
insert into iot_unit_icon
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="unitDesc != null">unit_desc,</if>
|
|
<if test="unitName != null">unit_name,</if>
|
|
<if test="resourceUrl != null">resource_url,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="unitDesc != null">#{unitDesc},</if>
|
|
<if test="unitName != null">#{unitName},</if>
|
|
<if test="resourceUrl != null">#{resourceUrl},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateUnitIcon" parameterType="UnitIcon">
|
|
update iot_unit_icon
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="unitDesc != null">unit_desc = #{unitDesc},</if>
|
|
<if test="unitName != null">unit_name = #{unitName},</if>
|
|
<if test="resourceUrl != null">resource_url = #{resourceUrl},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteUnitIconById" parameterType="Long">
|
|
delete from iot_unit_icon where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteUnitIconByIds" parameterType="String">
|
|
delete from iot_unit_icon where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |