實體定義
public class Entity {
private String refIpIds;
}
XML定義
<mapper namespace="com.ccssoft.rsas.hnflow.idcserviceopen.dao.IdcServiceOpenDao">
<sql id="idcServiceOpenColumns">
a.id AS "id",
a.ref_ip_ids AS "refIpIds"
</sql>
<sql id="idcServiceOpenJoins">
</sql>
<select id="get" resultType="com.ccssoft.rsas.hnflow.idcserviceopen.entity.IdcServiceOpen">
SELECT
<include refid="idcServiceOpenColumns"/>
FROM idc_service_open a
<include refid="idcServiceOpenJoins"/>
WHERE a.id = #{id,jdbcType=VARCHAR}
</select>
<insert id="insert">
INSERT INTO idc_service_open(
id,
ref_ip_ids
) VALUES (
#{id,jdbcType=VARCHAR},
#{refIpIds,jdbcType=CLOB}
)
</insert>
示例
IdcServiceOpen idcServiceOpen = new IdcServiceOpen();
idcServiceOpen.setRefIpIds(StrUtil.removeSuffix(refIpIds, ","));
idcServiceOpenService.save(idcServiceOpen);
IdcServiceOpen idcServiceOpen = idcServiceOpenService.get("id值");
String refIpIds = idcServiceOpen.getRefIpIds();