100 lines
4.1 KiB
XML
100 lines
4.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.psbc.cpsp.eden.mapper.asset.AssetLabelMapper">
|
|
<resultMap id="BaseResultMap" type="com.psbc.cpsp.eden.common.entity.AssetLabel">
|
|
<id column="id" property="id"/>
|
|
<result column="template_type" property="templateType"/>
|
|
<result column="label_items" property="labelItems"/>
|
|
<result column="paper_type" property="paperType"/>
|
|
<result column="label_width" property="labelWidth"/>
|
|
<result column="label_height" property="labelHeight"/>
|
|
<result column="create_user_id" property="createUserId"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="del_flag" property="delFlag"/>
|
|
<result column="last_mod_user_id" property="lastModUserId"/>
|
|
<result column="last_mod_time" property="lastModTime"/>
|
|
<result column="tenant_id" property="tenantId"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
"id", "template_type", "label_items", "paper_type", "label_width", "label_height",
|
|
"create_user_id", "create_time", "del_flag", "last_mod_user_id", "last_mod_time", "tenant_id"
|
|
</sql>
|
|
|
|
<!-- 新增资产标签 -->
|
|
<insert id="insert" parameterType="com.psbc.cpsp.eden.common.entity.AssetLabel" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO "tb_asset_label" (
|
|
"template_type", "label_items", "paper_type", "label_width", "label_height",
|
|
"create_user_id", "create_time", "del_flag", "last_mod_user_id", "last_mod_time"
|
|
) VALUES (
|
|
#{templateType}, #{labelItems}, #{paperType}, #{labelWidth}, #{labelHeight},
|
|
#{createUserId}, #{createTime}, #{delFlag}, #{lastModUserId}, #{lastModTime}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 修改资产标签 -->
|
|
<update id="update" parameterType="com.psbc.cpsp.eden.common.entity.AssetLabel">
|
|
UPDATE "tb_asset_label"
|
|
<set>
|
|
"template_type" = #{templateType},
|
|
"label_items" = #{labelItems},
|
|
"paper_type" = #{paperType},
|
|
"label_width" = #{labelWidth},
|
|
"label_height" = #{labelHeight},
|
|
"last_mod_user_id" = #{lastModUserId},
|
|
"last_mod_time" = #{lastModTime}
|
|
</set>
|
|
WHERE "id" = #{id} AND "del_flag" = '0'
|
|
</update>
|
|
|
|
<!-- 根据ID查询资产标签详情 -->
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
SELECT <include refid="Base_Column_List" />
|
|
FROM "tb_asset_label"
|
|
WHERE "id" = #{id} AND "del_flag" = '0'
|
|
</select>
|
|
|
|
<!-- 查询资产标签列表 -->
|
|
<select id="selectList" parameterType="com.psbc.cpsp.eden.common.entity.AssetLabel" resultMap="BaseResultMap">
|
|
SELECT <include refid="Base_Column_List" />
|
|
FROM "tb_asset_label"
|
|
WHERE "del_flag" = '0'
|
|
<if test="templateType != null and templateType != ''">
|
|
AND "template_type" = #{templateType}
|
|
</if>
|
|
<if test="paperType != null and paperType != ''">
|
|
AND "paper_type" = #{paperType}
|
|
</if>
|
|
ORDER BY "id"
|
|
</select>
|
|
|
|
<!-- 逻辑删除资产标签 -->
|
|
<update id="deleteById">
|
|
UPDATE "tb_asset_label"
|
|
SET "del_flag" = '1',
|
|
"last_mod_user_id" = #{lastModUserId},
|
|
"last_mod_time" = NOW()
|
|
WHERE "id" = #{id} AND "del_flag" = '0'
|
|
</update>
|
|
|
|
<!-- 批量逻辑删除资产标签 -->
|
|
<update id="deleteBatchIds">
|
|
UPDATE "tb_asset_label"
|
|
SET "del_flag" = '1',
|
|
"last_mod_user_id" = #{lastModUserId},
|
|
"last_mod_time" = NOW()
|
|
WHERE "id" IN
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
AND "del_flag" = '0'
|
|
</update>
|
|
|
|
<!-- 根据租户ID查询资产标签 -->
|
|
<select id="selectByTenantId" resultMap="BaseResultMap">
|
|
SELECT <include refid="Base_Column_List" />
|
|
FROM "tb_asset_label"
|
|
WHERE "del_flag" = '0'
|
|
LIMIT 1
|
|
</select>
|
|
</mapper> |