|
@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="type" column="type" />
|
|
|
<result property="price" column="price" />
|
|
|
<result property="phone" column="phone" />
|
|
|
+ <result property="status" column="status" />
|
|
|
<result property="address" column="address" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
@@ -19,16 +20,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectJnbQuotationsVo">
|
|
|
- select id, product_name, area, type, price, phone, address,url, create_by, create_time, del_flag from jnb_quotations
|
|
|
+ select a.id as id,
|
|
|
+ a.product_name as product_name,
|
|
|
+ a.area as area,
|
|
|
+ a.type as type,
|
|
|
+ a.price as price,
|
|
|
+ a.phone as phone,
|
|
|
+ a.address as address,
|
|
|
+ a.url as url,
|
|
|
+ a.create_by as create_by,
|
|
|
+ a.create_time as create_time,
|
|
|
+ a.del_flag as del_flag,
|
|
|
+ d.dict_label as status
|
|
|
+ from jnb_quotations a
|
|
|
+ LEFT JOIN sys_dict_data d on d.dict_code = a.status
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectJnbQuotationsList" parameterType="JnbQuotations" resultMap="JnbQuotationsResult">
|
|
|
- <include refid="selectJnbQuotationsVo"/>
|
|
|
- <where>
|
|
|
- <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
|
- <if test="area != null and area != ''"> and area = #{area}</if>
|
|
|
- <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
- and del_flag = 0
|
|
|
+ select a.id as id,
|
|
|
+ a.product_name as product_name,
|
|
|
+ a.area as area,
|
|
|
+ a.type as type,
|
|
|
+ a.price as price,
|
|
|
+ a.phone as phone,
|
|
|
+ a.address as address,
|
|
|
+ a.url as url,
|
|
|
+ a.create_by as create_by,
|
|
|
+ a.create_time as create_time,
|
|
|
+ a.del_flag as del_flag,
|
|
|
+ d.dict_label as status
|
|
|
+ from jnb_quotations a
|
|
|
+ LEFT JOIN sys_dict_data d on d.dict_value = a.status
|
|
|
+ <where>
|
|
|
+ d.dict_type = 'examine_state'
|
|
|
+ <if test="productName != null and productName != ''">and a.product_name like concat('%', #{productName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area != ''">and a.area = #{area}</if>
|
|
|
+ <if test="type != null and type != ''">and a.type = #{type}</if>
|
|
|
+ and a.del_flag = 0
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -40,10 +70,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectJnbQuotationsById" parameterType="Long" resultMap="JnbQuotationsResult">
|
|
|
- <include refid="selectJnbQuotationsVo"/>
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- and del_flag = 0
|
|
|
+ select a.id as id,
|
|
|
+ a.product_name as product_name,
|
|
|
+ a.area as area,
|
|
|
+ a.type as type,
|
|
|
+ a.price as price,
|
|
|
+ a.phone as phone,
|
|
|
+ a.address as address,
|
|
|
+ a.url as url,
|
|
|
+ a.create_by as create_by,
|
|
|
+ a.create_time as create_time,
|
|
|
+ a.del_flag as del_flag,
|
|
|
+ d.dict_label as status
|
|
|
+ from jnb_quotations a
|
|
|
+ LEFT JOIN sys_dict_data d on d.dict_value = a.status
|
|
|
+ <where>d.dict_type = 'examine_state'
|
|
|
+ and
|
|
|
+ id = #{id}
|
|
|
+ and del_flag = 0
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertJnbQuotations" parameterType="JnbQuotations" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -88,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
|
<if test="address != null">address = #{address},</if>
|
|
|
<if test="url != null">address = #{url},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
@@ -106,4 +152,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateByStatusAndId" parameterType="Long">
|
|
|
+ update jnb_quotations
|
|
|
+ set status = ${status}
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
</mapper>
|