|  |  |  | 
|---|
|  |  |  | <result column="name" jdbcType="VARCHAR" property="name" /> | 
|---|
|  |  |  | <result column="type" jdbcType="VARCHAR" property="type" /> | 
|---|
|  |  |  | <result column="image" jdbcType="BIGINT" property="image" /> | 
|---|
|  |  |  | <result column="director" jdbcType="BIGINT" property="director" /> | 
|---|
|  |  |  | <result column="director" jdbcType="VARCHAR" property="director" /> | 
|---|
|  |  |  | <result column="d_mobile" jdbcType="VARCHAR" property="dMobile" /> | 
|---|
|  |  |  | <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" /> | 
|---|
|  |  |  | <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> | 
|---|
|  |  |  | <result column="dt" jdbcType="TIMESTAMP" property="dt" /> | 
|---|
|  |  |  | <result column="remark" jdbcType="VARCHAR" property="remark" /> | 
|---|
|  |  |  | <association property="directorName" column="director" javaType="java.lang.Long" | 
|---|
|  |  |  | select="selectNameById" /> | 
|---|
|  |  |  | <collection property="params" ofType="com.dy.pmsGlobal.pojoPlt.PltProductParams" fetchType="eager" select="selectParams" column="id" /> | 
|---|
|  |  |  | <collection property="processDocuments" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectDocuments" column="id"/> | 
|---|
|  |  |  | <collection property="userManual" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectUserManual" column="id" /> | 
|---|
|  |  |  | <collection property="materials" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectMaterials" column="id"/> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <sql id="Base_Column_List"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | id, `name`, `type`, image, director, d_mobile,deleted, dt, remark | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | <select id="selectParams" resultMap="com.dy.pmsGlobal.daoPlt.PltProParamsMapper.BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from plt_product_params | 
|---|
|  |  |  | where pro_id = #{proId,jdbcType=BIGINT} and deleted !=1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectDocuments" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from plt_product_file | 
|---|
|  |  |  | where pro_id = #{proId,jdbcType=BIGINT} and file_type = '01' | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectUserManual" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from plt_product_file | 
|---|
|  |  |  | where pro_id = #{proId,jdbcType=BIGINT} and file_type = '02' | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectMaterials" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from plt_product_file | 
|---|
|  |  |  | where pro_id = #{proId,jdbcType=BIGINT} and file_type = '03' | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | 
|---|
|  |  |  | from plt_product | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectNameById" parameterType="java.lang.Long" resultType="java.lang.String"> | 
|---|
|  |  |  | select name directorName from ba_user where id=#{id} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | delete from plt_product | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProduct" useGeneratedKeys="true"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | insert into plt_product (`name`, `type`, image, | 
|---|
|  |  |  | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | <select id="selectSome" resultMap="BaseResultMap"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | <include refid="Join_Column_List" > | 
|---|
|  |  |  | <property name="alias" value="p"/> | 
|---|
|  |  |  | </include> | 
|---|
|  |  |  | <include refid="Base_Column_List" /> | 
|---|
|  |  |  | from plt_product p | 
|---|
|  |  |  | left join ba_user u on u.id=p.director | 
|---|
|  |  |  | where p.deleted!=1 and u.deleted!=1 | 
|---|
|  |  |  | where p.deleted!=1 | 
|---|
|  |  |  | <trim prefix="and " suffixOverrides="and"> | 
|---|
|  |  |  | <if test="type != null and type != ''"> | 
|---|
|  |  |  | p.type = #{type,jdbcType=VARCHAR} and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="name != null and name != ''"> | 
|---|
|  |  |  | p.name like concat('%', #{name}, '%') and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="director != null  and director != '' "> | 
|---|
|  |  |  | u.name like concat('%', #{director}, '%') and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dMobile != null and dMobile != '' "> | 
|---|
|  |  |  | p.d_mobile =#{dMobile,jdbcType=VARCHAR} and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dt != null and dt != '' "> | 
|---|
|  |  |  | DATE_FORMAT(p.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | order by id desc | 
|---|
|  |  |  | 
|---|
|  |  |  | <select id="selectSomeCount" resultType="java.lang.Long"> | 
|---|
|  |  |  | select count(1) | 
|---|
|  |  |  | from plt_product p | 
|---|
|  |  |  | left join ba_user u on u.id=p.director | 
|---|
|  |  |  | where p.deleted!=1 and u.deleted!=1 | 
|---|
|  |  |  | where p.deleted!=1 | 
|---|
|  |  |  | <trim prefix="and " suffixOverrides="and"> | 
|---|
|  |  |  | <if test="type != null and type != ''"> | 
|---|
|  |  |  | p.type = #{type,jdbcType=VARCHAR} and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="name != null and name != ''"> | 
|---|
|  |  |  | u.name like concat('%', #{name}, '%') and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="director != null  and director != '' "> | 
|---|
|  |  |  | p.director like concat('%', #{director}, '%') and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dMobile != null and dMobile != '' "> | 
|---|
|  |  |  | p.d_mobile =#{dMobile,jdbcType=VARCHAR} and | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dt != null and dt != '' "> | 
|---|
|  |  |  | DATE_FORMAT(p.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <select id="selectAll" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | <include refid="Base_Column_List" /> | 
|---|
|  |  |  | from plt_product p | 
|---|
|  |  |  | where p.deleted!=1 | 
|---|
|  |  |  | order by id desc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|