You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
1.8 KiB

<?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.gaotao.modules.part.mapper.ExternalLabelTemplateMapper">
<select id="queryLabelTemplate" resultType="com.gaotao.modules.part.entity.ExternalLabelTemplate">
select template_no, template_name, template_url, sort_no
from external_label_template
<if test="partNo!= null and partNo != '' and site!= null and site!= ''">
where template_no in (select template_no from external_part_picture where site = #{site} and part_no = #{partNo} and picture_classify = 'ProPicture' group by template_no)
</if>
group by template_no, template_name, template_url, sort_no
order by sort_no
</select>
<select id="queryLabelTemplateByPosition" resultType="com.gaotao.modules.part.entity.ExternalPartPicture">
select elt.template_no,
elt.picture_position,
elt.template_name,
epp.picture_url,
epp.site,
epp.part_no,
epp.picture_no,
epp.picture_desc,
epp.create_by,
epp.create_time,
bp.certification_no
from external_label_template elt
left join external_part_picture epp
on epp.template_no = elt.template_no
and epp.picture_position = elt.picture_position
and epp.part_no = #{partNo}
and epp.site = #{site}
and epp.picture_classify = 'ProPicture'
left join base_picture bp on epp.base_picture_no = bp.picture_no
where elt.template_no = #{templateNo}
order by elt.sort_no
</select>
</mapper>