| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.SOPMapper"> |
| | | |
| | | <resultMap id="sopList" type="sop"> |
| | | <resultMap id="sopList" type="SOP"> |
| | | <id property="id" column="id"></id> |
| | | <result property="fileName" column="file_name"></result> |
| | | <result property="fileType" column="file_type"></result> |
| | |
| | | <result property="releaseNotes" column="release_notes"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="uploadUser" column="upload_user"></result> |
| | | <collection property="sopProductList" ofType="sOPProduct"> |
| | | <id column="id" property="id"/> |
| | | <collection property="sopProductList" ofType="SOPProduct"> |
| | | <id column="sid" property="id"/> |
| | | <result column="code" property="code"/> |
| | | <result column="model" property="model"/> |
| | | <result column="sop_id" property="sopId"/> |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getSopInfo" resultMap="sopList"> |
| | | select * from tb_sop,tb_sop_product |
| | | select *, tb_sop_product.id as sid from tb_sop |
| | | LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id |
| | | <where> |
| | | tb_sop.id=tb_sop_product.sop_id |
| | | 1=1 |
| | | <if test="code!=null"> |
| | | and code LIKE '%${code}%' |
| | | </if> |