1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="PubDbXRef">
<typeAlias alias="PubDbXRef"
type="org.gmod.schema.pub.PubDbXRef"/>
<resultMap id="select-pubdbxref" class="PubDbXRef">
<result property="pub.pubId" column="pub_id" />
<result property="dbXRef.accession" column="accession" />
<result property="dbXRef.version" column="version" />
<result property="dbXRef.description" column="dbx_description" />
<result property="dbXRef.db.name" column="name" />
<result property="dbXRef.db.description" column="description" />
<result property="dbXRef.db.urlPrefix" column="urlprefix" />
<result property="dbXRef.db.url" column="url" />
</resultMap>
<!-- SQL -->
<select id="getPubDbXRef" resultMap="select-pubdbxref">
select pub_id, pub_dbxref.dbxref_id,
accession, version, dbx.description AS dbx_description,
db.name, db.description, db.urlprefix, db.url FROM pub_dbxref
LEFT JOIN dbxref dbx ON pub_dbxref.dbxref_id=dbx.dbxref_id
LEFT JOIN db ON db.db_id=dbx.db_id
</select>
<!-- WRITE BACK -->
<insert id="insertPubDbXRef" parameterClass="PubDbXRef">
INSERT INTO pub_dbxref ( pub_id, dbxref_id )
VALUES ( $pub.pubId$, $dbXRef.dbXRefId$ )
</insert>
</sqlMap>
|