InwardtItemMapper.xml 1.33 KB
<?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="cn.com.polysoft.template.dao.InwardtitemMapper" >

    <select id="queryItemIdByCondition" resultType="string">
        select itemid from inwardtitem where treatyid = #{treatyNo} and classname = #{className}
    </select>

    <select id="queryItemIdByTreatyNo" resultType="cn.com.polysoft.template.entity.InwardtitemEntity">
        SELECT
            idt.treatyid,
            inw.itemid
        FROM
            inwardtreatyinfo idt
        LEFT JOIN inwardtitem inw ON idt.treatyid = inw.treatyid
        WHERE
            idt.counterpartyid = #{treatyNo}
    </select>

    <select id="queryItemExpByTreatyIdAndItemId" resultType="java.lang.String">
        select itemexp from inwardtitem t where t.treatyid=#{treatyId} and t.itemid=#{itemId}
    </select>

    <select id="queryItemIdAndItemExpByTreatyId" resultType="cn.com.polysoft.template.dto.InwardtitemDto">
        select id,itemid itemId,itemexp itemExp,treatyid treatyId from inwardtitem t where t.treatyid in
        <foreach collection="list"
                 item="sign" separator=","
                 open="(" close=")">
            #{sign}
        </foreach>
        order by t.treatyid,t.itemid
    </select>
</mapper>