<?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.artfess.bpm.persistence.dao.BpmWatermarkDao">
	<resultMap id="BpmWatermark" type="com.artfess.bpm.persistence.model.BpmWatermark">
		<id property="id" column="ID_" jdbcType="VARCHAR"/>
		<result property="name" column="NAME_" jdbcType="VARCHAR"/>
		<result property="content" column="CONTENT_" jdbcType="VARCHAR"/>
		<result property="type" column="TYPE_" jdbcType="NUMERIC"/>
		<result property="color" column="COLOR_" jdbcType="VARCHAR"/>
		<result property="amount" column="AMOUNT_" jdbcType="NUMERIC"/>
		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
		<result property="createOrgId" column="CREATE_ORG_ID_" jdbcType="VARCHAR"/>
	</resultMap>

	<select id="getByTypeId" parameterType="java.lang.String" resultMap="BpmWatermark">
		select watermark.* from bpm_watermark watermark
		left join bpm_watermark_type t on t.watermark_id_ = watermark.id_
		where t.type_id_ = #{typeId}
	</select>
</mapper>